Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,849
Community Members
 
Community Events
184
Community Groups

Curl with customfield and subfield

Hi,
In Jira we have some page which have values like this:
customfield_12345 and customfield_12345:1. 

The customfields with numbers are okay, I've checked in the browser with console.

Few lines below is json which I use for curl. But when I use it I got following error: 

 {"errorMessage":"Unable to to create request because of theses errors : The field 'customfield_12650:1' is not valid for this request type 'Incident'.","i18nErrorMessage":{"i18nKey":"sd.request.create.error.failed.msg","parameters":["The field 'customfield_12650:1' is not valid for this request type 'Incident'."]}}

How should I format json message to get it working?

 

MESSAGE='{
"serviceDeskId":"1",
"requestTypeId":"12",
"requestFieldValues":{
"summary":"Heya",
"customfield_13225":"'bang bang'",
"customfield_13917":{
"value":"'$TESTENVIRONMENTVALUE'",
"id":"'$TESTENVIRONMENTID'"
},
"customfield_18611":{
"value":"'$SITEVALUE'",
"id":"'$SITEID'"
},
"description":"Hello",
"customfield_13680":{
"value":"Hey",
"id":"161239"
},
"customfield_12650":{
"value":"'$ORGANIZATIONVALUE'",
"id":"'$ORGANIZATIONID'"
},
"customfield_12650:1":{
"value":"'$ORIGINVALUE'",
"id":"'$ORIGINID'"
},
"customfield_14418":{
"value":"Poland (GMT/UTC + 01:00 hour)",
"id":"16053"
},
"customfield_12314":[
{
"value":"Not flow related",
"id":"55564"
}
],
"priority":{
"name":"1",
"id":"4"
}
}
}'

 

Thanks!

2 answers

1 accepted

Hi,
The 12345:1 was just an example.
I got this ID from elements tab from browser console, below's screenshot: 

 
halp2.png

halp3.png

Based on 12650 list, different lists should appear in 12650:1, and I want to set that with a script.
Thanks! 

Graham Twine
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 25, 2023

Ah, cascading select is not updated like that.

Remove this all together

"customfield_12650:1":{
"value":"'$ORIGINVALUE'",
"id":"'$ORIGINID'"
},

Make the child value part of the field

"customfield_12650": {
"value": "$ORGANIZATIONVALUE",
"child": {
"value": "$ORIGINVALUE"
}
}
Like Mainstreamowy Daniel likes this

Thanks a lot! 
It works now :) 

2 votes
Graham Twine
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 25, 2023

Hello @Mainstreamowy Daniel ,

 

Where are you getting this id 12345:1?

Please share a screen grab if possible. From what I am aware custom field IDs should never contain special characters. They only contain customfield_ followed by digits.

 

Check the field ID in Custom Fields and also confirm if the field you are looking for is on the global scope or scoped to the project and issue type you are attempting to create.

 

From your error

"The field 'customfield_12650:1' is not valid for this request type 'Incident'."

1. The ID is not a valid ID

2. The fields scope is not correct

3. The field is not associated to request type with ID 12

Suggest an answer

Log in or Sign up to answer