I've been racking my brain trying to get the right JSON format for an automation that runs every day.
The audit log says -
Error while parsing additional fields. Not valid JSON.
My JSON currently says -
{
],
{ "Custom Field Name": {100_93": {"value":"100_10231", "child": { "value" : "10272"}
}
}
}
Can someone help me in telling me what is wrong? I can supply the names of my custom fields if that's helpful.
Thanks.
Hi @Shaun Speers and welcome to the community!
Assuming your field name is "100_93", it should work with this:
{
"fields": {
"100_93" : { "value": "100_10231", "child": { "value" : "10272"} }
}
}
So with this information you could either use the custom field id or the field name. Depending upon how you want to go about this, your json would look like this:
Field Name
{
"fields": {
"Maintenance Category" : { "value": "10231", "child": { "value" : "10272"} }
}
}
Field ID
{
"fields": {
"customField_10093" : { "value": "10231", "child": { "value" : "10272"} }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The rule will update successfully, but not run. The audit log just says "error creating the issue."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm... I tried it in my test environment and it worked correctly. Can you please share a screenshot of the audit log messaging?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Given your last post re values... You do need to ensure the values exactly match. Based upon the screenshot you sent to @marc -Collabello--Phase Locked- you probably need to change it to this:
{
"fields": {
"customField_10093" : { "value": "Daktronics Sign(10231)", "child": { "value" : "Visitors(10272)"} }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think we have the JSON!
The automation will not run, and the audit log is a bit vague. The only thing i changed was the JSON.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah the log is definitely lacking in detail. Here are a couple things that I would look into:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The rule actor was Automation for JIRA. I went ahead and changed it to myself. Still producing the same error - a vague one.
All starred fields are correct
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried duplicating the automation in my sample space. I associated the fields with that project. But not the request types. In our sample space, I changed it to just a task. It's still erroring out with the vague error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you add that custom field to the site or is it from a marketplace addon / app?
Regarding the values you are trying to use in the JSON, have you confirmed they match exactly, including any spaces, to the allowed values?
One way to check that would be to create an issue with those exact values for the cascading field, and then use this how-to article to view what valid values would look like as JSON: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The custom field was added from the site.
If I go to try and find the smart value, I can only find the custom field ID (10093 in my case)
Do I need to expand to see the parent/child values or should they be there already?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you use that how-to method, for an example issue with the parent / child values set for a cascade field, both should be visible in the JSON.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I plug in cascade list.value, under 10093, it does not show the correct parent and child values. Even though the issue I'm looking at has the correct parent/child values.
I've redacted our URL to JIRA but copied the rest below.
"customfield_10093": {
"self": "[redacted]/rest/api/2/customFieldOption/10241",
"value": "Mattresses",
"id": "10241",
"child": {
"self": "[redacted]rest/api/2/customFieldOption/10511",
"value": "STAINED MATTRESS/ REPLACE",
"id": "10511"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That would seem to indicate you are looking at a different field; however, which values are you looking for in that result: the id or the value?
When you edit a option / cascading field, you may set the selections by the id or the value. The id is the internal Jira value for the field and is not user-controlled.
In some of your examples, you seem to be setting "value" to the id, not the human-readable dropdown text, and that will not work.
Please look at this example again to confirm how this is done:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe the JSON in your original post has at least 2 syntax errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm starting to think this may have something to do with the names. This is what my old issues look like with the correct parent and child values.
Here are the names of the fields and my current JSON.
I really appreciate the input. I'm getting the hand of JIRA but I'm definitely not a programmer. LOL!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My field name is actually Interior Maintenace Category. The ID is 10093.
My parent value ID is 10231 and the child ID is 10272.
It would not work with fields, so I changed it to update field. Still getting the same error. I want to be able to set the same parent and child value to this custom field every day.
Currently looking like -
{
"update field": {
"100_93" : { "value": "10231", "child": { "value" : "10272"} }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.