Automation is not recognizing a JSON value because the value includes a slash or a dash

Lexi Huefner May 2, 2023

I am setting up automation to create subtasks on tickets created from our service desk. I have to set a required cascading list field. All of my JSON is working except for the following: 

{
"fields": {
"access_type": { "value": "Google Workspace / GSuite (manual approval rqd)" }
}
}

 

{
"fields": {
"access_type": { "value": "iLMS - Inspired eLearning (manager approval)" }
}
}

 

For comparison this one does work: 

{
"fields": {
"access_type": { "value": "Active Directory (manual approval rqd)" }
}
}

 

I suspect it's related to the "-" and "/" in the ones that aren't working. I am new to JSON and I couldn't find anything to indicate I needed to escape out of those characters but maybe I'm wrong. I'm not sure where else to look. any help is appreciated!

2 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
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 2, 2023

Hi @Lexi Huefner 

Have you tried using the parent and child syntax for the cascading field, as described here: 

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Cascading-select-custom-field

Kind regards,
Bill

Lexi Huefner May 3, 2023

I did not try using "id" but I have used "value". That's what you see above. Do I need to include child? There is no child necessary for the parent field so I excluded that part. It worked on all of the other ones I created. Only these 2 aren't working. 

I'll try id and let you know. Thanks!

Like Bill Sheboy likes this
Lexi Huefner May 3, 2023

Do you know how I find the id for the option I need? I can only find articles on how to find the custom field id.

Bill Sheboy
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 3, 2023

I recall seeing an experimental REST API to get the options, but I cannot find it.

One way I know works is to set the option you want in an issue, and then call the REST API to get the possible smart values, search for your field, and you will find the option id, as described in this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Basically you call the function with a browser for your issue like this, and then find the option id:

yourJiraUrl/rest/api/2/issue/yourIssueKey?expand=names

Lexi Huefner May 3, 2023

That worked! Thanks so much!

Like Bill Sheboy likes this
0 votes
Lexi Huefner May 2, 2023

This is the error I see.Screenshot 2023-05-02 at 3.32.00 PM.png

Suggest an answer

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

Atlassian Community Events