Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create new issue of type 'Bug' with custom field of type 'Labels'

Yahm Levi-Firseck July 12, 2022

Trying to open a bug with all sorts of custom and non-custom fields. Everything works as expected except of one custom field, of type 'Labels'.

The following is the .json file I post, where the question mark is the problematic part (as far as I can tell):

 

{
    "fields":{
       "project":{
          "key":"PIM"
       },
       "summary":"Qualys - summary-place-holder",
       "priority": {"name": "Minor"},
       "labels": ["Security"],
       "issuetype":{
          "name":"Bug"
       },
       "customfield_13758": { "value": "Automation Testing" },
       "customfield_10180": { "value": "No" },
       "customfield_13790": { "value": "No" },
       "customfield_11092": ????,
       "components":[
          {
             "name":"R&D internal"
          }
       ]
    }
 }
I've tried all sorts of variations, the furthest I seem to get is when trying to use versionPicker (https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#versionpicker) type (as I don't find how to use a 'Labels' type), and I'm getting the following error message:
{"errorMessages":[],"errors":{"customfield_11092":"Specify an string at index 0 for Affects Version(Label)"}}
Been grinding on this the entire day... PLEASE HELP!

2 answers

1 accepted

0 votes
Answer accepted
Yahm Levi-Firseck July 21, 2022

Turns out it should be posted as follows:

"versions":[
         {
            "name":"version"
         }
      ],
0 votes
John Funk
Community Champion
July 12, 2022

Hi Yahm - Welcome to the Atlassian Community!

I don't know much about JSON, but why are you using an API to create the issue and not using something simple like Automation for Jira? 

Yahm Levi-Firseck July 12, 2022

Hi!

Thanks for the reply!

I'm using the API because it's most convenient for me. I use it from a Jenkins pipeline.

I use JSON simply to pass the data to Jira, as mentioned here https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#versionpicker.  

John Funk
Community Champion
July 12, 2022

Well, you might do what is working and then add an automation rule just to update the labels type field after the issue is created. 

Yahm Levi-Firseck July 13, 2022

The thing is that this field is required when opening an issue.

Isn't there any documentation to using a custom field with type 'Labels'?

John Funk
Community Champion
July 13, 2022

I can't speak to that. I would either use a different field when creating or update it afterward. Either way, I would make it so that field is not required to create an issue. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events