Jira Cloud: Cannot set Category field – "Provide a valid 'id' or 'name'" error

Hi everyone,

I’m trying to map a single-select Category field in Jira Cloud via Make, but I keep getting the following error: customfield_12815: Provide a valid ‘id’ or ‘name’ for Category.

Here’s what I’ve tried so far in the mapping (all with the switch() function to map label to ID):

What is the correct way to send the expected object value (with id) to Jira?

Can someone please help with this issue? :frowning:

Welcome to the Make community!

What options do you get if you untoggle/turn OFF Map for the category field, are you able to select multiple items, then toggle it back ON to see what form of data remains in the field?

What are some example values for module [3]?

Please provide the output bundles of each of the relevant module [3] by running the scenario (you can also get this without re-running your scenario from the History tab).

Click on the white speech bubbles on the top-right of each module and select “Download input/output bundles”.

A. Upload as a Text File

Save each bundle contents in a plain text editor (without formatting) as a bundle.txt file.

You can upload the file here by clicking on this button:

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
Here are some ways to provide text content in a way that it won’t be modified by the forum.

  • Method 1: Type code fence manually
    Add three backticks ``` in a separate line before and after the content, like this,

    ```
    text goes here
    ```
    
  • Method 2: Highlight and click the “preformatted text” button in the editor

  • Method 3: Upload your file and share the public link
    (this method is only recommended for large files exceeding the forum upload limit)

Providing the input/output bundles will allow others to replicate what is going on in the scenario, especially if there are complex data structures (nested arrays and collections) or if external services are involved, and help you with mapping the raw property names from collections.

This will allow others to better assist you. Thanks!

Hope this helps! Let me know if there are any further questions or issues.

@samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

Thank you @samliew!

Disabling Map, selecting ‘New Marketplace Integration’, and executing the automation results in the field showing the ID (14992).

Here is the input bundle for this example:

[
    {
        "project": "11646",
        "summary": "My title",
        "issueType": "11163",
        "customFields": {
            "customfield_12595": [
                "14564"
            ],
            "customfield_12606": "This is a description",
            "customfield_12782": "Lorem ipsum",
            "customfield_12815": "14992"
        }
    }
]

and the output bundle:

[
    {
        "id": "72058",
        "key": "PNP-73",
        "self": "https://channelpilot.atlassian.net/rest/api/3/issue/72058"
    }
]

Here’s the structure of the Microsoft Lists table from which I want to transfer the data.

So it looks like the variable {{3.customFields.customfield_12815}} already contains the category ID. Why do you need a switch statement?

Just leave that variable directly in that field.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

@samliew That was my initial approach; unfortunately, it doesn’t work. I then receive this error:

[400] customfield_12815: Please provide a value for ‘Category’. Permitted values are 14992 [New Marketplace Integration], 14993 [Existing Marketplace Optimization], 14994 [Feed & Data Management], 14995 [Platform Core], 14996 [Integrations & API], 14997 [User Experience], -1.

Input bundle:

[
    {
        "project": "11646",
        "summary": "zuzu",
        "issueType": "11163",
        "customFields": {
            "customfield_12595": [
                "14564"
            ],
            "customfield_12606": "zuztuz",
            "customfield_12782": "zutzuztu",
            "customfield_12815": "Platform Core"
        }
    }
]

As you can see, the first bundle you provided is different to the second one, one containing the ID in a text string and another text.

Perhaps you’ll also need to cast/convert the ID string into a number. To do this you can use the parseNumber function around the switch statement.