When someone changes the Target end date ( which is a field available in automation) I want JIRA to automatically change a custom field (Projected End) to the same date. I would like to use automation for this, but the custom field doesn't show up so I need a simple JSON script that I can use in automation. I not familiar with how to write a JSON so here is what I got so far
{
"Fields": {
"Projected End" : "Target end",
}
}
Yes I know this is not correct and I need to be fired from my job, but before that happens I would like to know how to do this.
Please help if you can, thanks
Hello @devansusaf99
Welcome to the Atlassian community.
On the right side, where you have "Target end", you need to use a Smart Value to get the value from that field. Have you learned about Smart Values?
https://support.atlassian.com/cloud-automation/docs/smart-values-in-jira-automation/
The exact smart value you need depends on the structure of your rule. Can you provide a screen image showing your entire rule and point out the step where you are trying to set the Projected End field?
The likely smart value is
{{issue.Target end}}
...enclosed in double-quotes. That tells the rule to get the value from the field named "Target end" for the issue currently in context in the rule. Note that when you provide a field name like "Target end" in a smart value you have to supply it exactly as it appears in your screens - this is case and spacing sensitive.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that image.
One thing to clarify is that you tagged your post as being related to Jira Cloud. The screen image you provided shows the graphics used in Jira Data Center, not Jira Cloud.
When asking for help with an Automation Rule it is important to accurately identify your hosting/product type (Cloud vs. Data Center) as the two provide slightly different capabilities.
And when the environment is Jira Data Center, it is also helpful if you tell us the version you are using, as some capabilities may not be available for older versions.
Addressing your rule, now.
First, you don't need the "For: Current Issue" branch. You can have the Edit Issue action directly after the Trigger.
Second, there are problems in your JSON.
1. The smart value needs to be enclosed in double quotes, literally:
"{{issue.customfield_10204}}"
2. You have an extraneous blank space that needs to be removed.
3. You need to remove the comma that follows the smart value.
If you make those changes and the rule does not work as you expect, please provide screen images showing the output from the rule Audit Log for when the rule ran after the changes are made.
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.
You are welcome!
If my responses helped you implement a working solution for your requirement, please consider clicking on the Accept Answer button above my response to mark your Question as Solved.
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.