I am trying to use Automation to clone a ticket on a Schedule and JQL query.
Project - HD (this is the source project and the Issue type does not have the Cascading Custom Field)
Project - FAC (this is the destination project and has the Cascading Field, it is also Required to create)
I have tried several versions of the More Options (Additional Fields) as the Cascading Field is not a selection.
Here is the Code that I am using:
{
"update": {
"customfield_14705": [
{
"set": {
"BLD 11": "{{triggerIssue.fields.customfield_14705.value}}",
"child": {
"1ST FLOOR": "{{triggerIssue.fields.customfield_14705.child.value}}"
}
}
}
]
}
}
When I run the Automation, it fails stating that it needs the Custom Field.
JIRA Data Center version 10.3.7
Correct code for Cascading Fields
{
"fields": {
"customfield_14705" : { "value": "BLD 11", "child": { "value" : "1ST FLOOR"} }
}
}
Hello @AndreH
You said the source project does not have the custom field.
But in the JSON code you are trying to set the custom field in the destination project by referencing values in the source issue for that same field, which you have said doesn't exist in the source project.
When you use triggerIssue you are telling the automation rule to get a value from the rule that triggered the issue. If customfield_14705 has no value in the trigger issue, then the above code is supply no value to use in setting the field in the destination issue. Therefore the field is blank and the validation to ensure it has been filled in fails.
If the source project does not use that field, but the destination project does and requires it to be filled, then what value to you want to use to set the field in the destination project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I am only trying to set the values in the Project B (destination project).
I've changed it to -
{
"set": {
"customfield_11447" : { "BLD 11": "parent_option1", "child": { "1ST FLOOR" : "p1_child1"} }
}
}
}
]
}
}
Tried Add and Ser, still gives the error that the field is required.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the code you showed above you changed the customfield ID, so you are no longer trying to set customfield_14705. That is likely the reason you are still getting the same error.
Additionally your syntax is incorrect. Referring to the example in the documentation:
https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html
Select a single parent value then a related child value. You can address them by 'value' or by 'id'.
"customfield_11447" : { "value": "parent_option1", "child": { "value" : "p1_child1"} }
or
"customfield_11447" : { "id": 10112, "child": { "id" : 10115 } }
You need to literally use "value" or "id" as the first part within the curly braces, and follow that with the actual value of the option you want to assign. When you use "value" you are telling the system the next thing supplied is the value you want to assign to the field. When you use "id" you are telling the system that the next thing supplied is the numeric ID for the value you want to assign to the field
If "BLD 11" is the value at the parent level and "1ST FLOOR" is the value at the child level, then the syntax you would need is
{
"update": {
"customfield_14705: {
"value": "BLD 11",
"child": {
"value": "1ST FLOOR"
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I was copying and pasting from the Atlassian doc.
I tried
{
"update": {
"customfield_14705": {
"value": "BLD 11",
"child": {
"value": "1ST FLOOR"
}
}
}
}
And it's giving me - Error while parsing additional fields. Not valid JSON
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you provide a screen image showing the code you pasted into the action?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I figured out the issue, the trailing brackets were the cause ] and }}}
This code works
{
"fields": {
"customfield_14705" : { "value": "BLD 11", "child": { "value" : "1ST FLOOR"} }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are missing the closing double-quotes at the end of he custom field name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I figured out the issue, the trailing brackets were the cause ] and }}}
In the image you provided there were no "]" (square brackets). The only error was the missing quotes.
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.