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,462,950
Community Members
 
Community Events
176
Community Groups

Copy custom field with jira automation Json when creating a subtask

Hi!

I have a board in which I have a custom field with a dropdown list and sublist. I´m trying to automate copying this field of the main issue into the subtask that  is being created, but I don't seem to find the correct Json expression:
This is what I have right now:

{
"fields": {
"customfield_10463": { "value": "{{parentIssue.customfield_10463.value}}", "child": { "value" : "{{parentIssue.customfield_10463.child.value}}"} }
}
}

 

 

The trigger is when an issue is created and has a condition that is when the issue type is a subtask

Thank you!

2 answers

1 accepted

2 votes
Answer accepted
Trudy Claspill Community Leader Dec 15, 2022

Is your rule generating an error message in the audit log? If so, what is the error message?

Can you use Log actions to print to the rule audit log the values for the parent issue field to make sure you are getting the values you expect? 

{{parentIssue.customfield_10463.value}}

{{parentIssue.customfield_10463.child.value}}

Hi Trudy! Will leave you a screenshot down below

Hi @Trudy Claspill , 

Is not getting any error message, it says Success, but with the log actions, both values come up empty. I double-checked the custom field ID and it is right, I have an automation that can copy this field, but only when the issue is transitioned, I copied the CF Id from there. I´m not sure why is coming up empty in this automation.

I tried with your log action Json with another custom field that is being copied in another automation and it comes up also empty on the audit log.

 

My trigger is when an issue type "Candidate" (subtask) is being created, then it compares the issue type to ensure is type "candidate" and then the action is the Json to copy the field from the parent issue into the new subtask, followed by the Log actions you recommended.

Screenshot automation V2.png

 

I´m not sure why the custom field on the parent issue always comes up empty, including other custom fields that I tried. I don´t think is the Json anymore, but the reason why is not bringing the values. Is there any way I can fix this?

Thank you Trudy!

Trudy Claspill Community Leader Dec 16, 2022

Hello @Diego Sanchez Cambas 

Teachable moment:

As a next debugging step I would try printing out {{parentIssue.key}} to make sure you are referencing a valid issue.

If you don't get the value you expect, then that would suggest that you are not referencing the parent issue correctly. At that point I would start looking at the documentation, which is exactly what I did.

From reviewing documentation on Smart Values I have discovered that you are referencing the parent issue incorrectly. Refer to

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--issue.parent--

Instead of parentIssue you need to be using issue.parent so that the automation know which issue's parent you are referencing.

Like Diego Sanchez Cambas likes this

Hi @Trudy Claspill 

I tried with the Issue.parent and that worked perfectly! thank you very much!!!

Suggest an answer

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

Atlassian Community Events