Forums

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

automation update field for Children when the parent field is updated

Jack Brickey
Community Champion
June 18, 2025

So I think I have done this 1 million times in the past successfully and yet here I am again trying to figure out what is wrong with my JSON. I have to be doing something stupid and I'm just too close to the trees to see it so looking for some fresh eyes.

note: I have spent a lot of time researching existing Community posts and docs but still stuck.

Use case - I am setting up an automation to update the Category field in the children of an epic when that same field is updated in the epic.

Below is a screenshot of the important bit of my rule but below are the variations of the JSON I have attempted.

{
    "fields": {
        "customfield_43602”: "{{issue.parent.customfield_43602.value}}”
    }
}
{
    "fields": {
        "customfield_43602”: {"{{issue.parent.customfield_43602.value}}” }
    }
}
{
    "fields": {
        "customfield_43602”: {"value": "{{issue.parent.customfield_43602}}” }
    }
}

I have verified via log action that  {{issue.parent.customfield_43602.value}} yields the desired value.

 

Update: One thing I noted is that given that this is an Atlassian locked field I checked on the type and it is shown as "Unknown". While it certainly has the behavior of a Single select it may require a different JSON syntax? Will explore...

 

 

image (5).png

5 answers

2 accepted

1 vote
Answer accepted
Jack Brickey
Community Champion
June 18, 2025

So I have landed on the solution but have one error to work out but wanted to provide an update here to everyone.

So the clue came when I looked at the field type and being listed as unknown. Ultimately I tried to use "id" instead of name or value based upon this finding. So my current JSON looks like this...

{
  "fields": {
    "customfield_43602": {
      "id": "{{parentCategory}}"
    }
  }
}

where parentCategory is a variable defined as {{issue.parent.customfield_43602.id

This WORKED! However, I do get an error that I need to understand...

image (6).png

Jack Brickey
Community Champion
June 18, 2025

and I just discovered this old post where the incredible @Mikael Sandberg offers the same solution. Maybe he can offer further context to understand when/why ID is required?

Matthias Gaiser _K15t_
Community Champion
June 18, 2025

@Jack Brickey - whenever I have these challenges, I usually get a JSON response of the issue in question via the get issue endpoint, e.g. https://YOURINSTANCE.atlassian.net/rest/api/2/issue/ISSUE-KEY.

This contains for the category field this JSON:

"customfield_10058": {
"self": "https://YOURINSTANCE.atlassian.net/rest/api/2/customFieldOption/10387",
"value": "first",
"id": "10387"
}

Then I use the edit issue endpoint to update that issue and vary the content. For category, it either works with the id or the value with a payload like this:

{
"fields": {
"customfield_10058": {
"value": "first"
}
}
}

Maybe that helps iterating the payload faster to find a solution in the future.

Like Jack Brickey likes this
Mikael Sandberg
Community Champion
June 18, 2025

@Jack Brickey If my memory serves me correctly I believe I used this KB as a reference regarding the Category field. I had a similar automation that needed to set the category when a work item was created and at the time you could only use the ID for the value, but it looks like now you can also use the name.

Maciej Dudziak _Forgappify_
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.
June 18, 2025

@Jack Brickey I got the same error, when I forgot to remove the field from the Choose fields dropdown

Jack Brickey
Community Champion
June 18, 2025

Thanks guys!!!

@Mikael Sandberg , the KB is a great resource, however, i could not get value to work which is what was driving me mad. In the KB they use actual text, e.g. "Marketing" where I am actually using smart values but I would certainly expect that smart values would be an option.  If you get a chance I would love to know if you are successful using value and if so, where my syntax of using value is in error.

0 votes
Answer accepted
Maciej Dudziak _Forgappify_
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.
June 18, 2025

Hi @Jack Brickey 

This is something that works for Single Select

{
"fields": {
"customfield_10044": {
"value" : "{{issue.parent.customfield_10044.value}}"
}
}
}

:) 

Cheers

Jack Brickey
Community Champion
June 18, 2025

thanks @Maciej Dudziak _Forgappify_ ,

indeed it does but was not for "Category" which is a special (?) JWM field. I found you must (?) use "id" instead of value.

Jack Brickey
Community Champion
June 18, 2025

@Maciej Dudziak _Forgappify_ , actually this does work and fundamentally answers my original question. What I was missing and did not initially see in your answer, due to me being heads down in using ID rather than value, was the ".value" within the smart value.

while i was simply using this...

{
    "fields": {
        "customfield_43602”: {"value": "{{issue.parent.customfield_43602}}” }
    }
}

I should have been using this...

{
    "fields": {
        "customfield_43602”: {"value": "{{issue.parent.customfield_43602.value}}” }
    }
}

that was my stupid mistake! 

bravo my friend!

1 vote
arielei
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.
June 18, 2025

Hey @Jack Brickey 

You can copy from the parent:
Screenshot 2025-06-18 at 15.50.02.png

Jack Brickey
Community Champion
June 18, 2025

hi @arielei , thank you for responding. Unfortunately, not all fields are available in the drop-down selection. It can be very frustrating especially when the field is an actual system field like Category in this case. This is why I am using the advanced JSON approach and leveraging the custom field ID.

0 votes
Dick
Community Champion
June 18, 2025

instead of 

"{{issue.parent.customfield_43602}}"

I always use {{issue.parent.customfield_43602.asJsonString}}

described Here

Jack Brickey
Community Champion
June 18, 2025

Thanks @Dick , I will have to try this too!

0 votes
Karan Sachdev
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2025

Hey @Jack Brickey

Like you stated, this is a very common use case of automation rules.

I usually run the below endpoint to verify the operations available for a given field:

https://sitename.atlassian.net/rest/api/3/issue/%7BissueIdOrKey%7D/editmeta

If its a multi-select field that supports add, set, remove operations, the below format might help:

{

"update": {

"customfield_43602": [{

"add": { "value": "{{issue.parent.customfield_43602}}" }

}]

}

}

In case you have tried this already, I look forward to the suggestions from community experts on this.

Thanks! 

Karan Sachdev
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2025
Jack Brickey
Community Champion
June 18, 2025

thanks @Karan Sachdev , it isn't multi-select but rather single-select. Good tip on the API. I will check that out. I am quite puzzled by why my initial attemps have not worked based on my past successes. I'm sure it will be obvious once solved.

Like Karan Sachdev likes this
Matthias Gaiser _K15t_
Community Champion
June 18, 2025

@Jack Brickey, can you share the type of the category field? You can check this endpoint for the type of all the fields: https://ecosystem.atlassian.net/rest/api/2/field (Of course with your own Jira url). If you then copy/paste that information, we might be better able to help you.

Here's an example for Jira Work Management's category field:

{
"id": "customfield_20126",
"key": "customfield_20126",
"name": "Category",
"untranslatedName": "Category",
"custom": true,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames":
[
"Category[Category]",
"cf[20126]"
],
"schema":
{
"type": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:jwm-category",
"customId": 20126
}
}

 

Jack Brickey
Community Champion
June 18, 2025

thanks @Matthias Gaiser _K15t_ , indeed this is what i get as well. just a different id number. So is there somewhere that explains that using "id" for "type" = "option" is required or maybe it isn't? 

Basically, my question is this, what bit of information dictates the need of using the ID here and how does one know to go down that path?

Suggest an answer

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

Atlassian Community Events