My automation's end goal is this:
- Issue has Field X updated
- Update Field Y (user picker) based on Field X's value
- If Field Y had a previous value (user), email old value and new value
Bullet Point 1 and 2 working great.
Things aren't working at the email step (bullet point 3)
As part of Bullet Point 1, I'm creating two custom variable to record the current Field Y's value (display name and email). Then, in Bullet Point 3, I'm trying to email the old value and the new value. This is working, however the values for my custom vairaibles and Field Y are the same. It's as if Field Y's new value isn't available at the time of the rule.
I'm using an If Else branch to accomplish Bullet Point 2 because we have 5 possible Field Y users and ~30+ Field X values (If field X equals one of these, update Field Y to User 1, else if field X equals one of these, upate Field Y to user 2 etc)
I can't figure out if I need a new custom variable that's set after each If Else... and then I use that? But that's a very manual process and seems wrong.
I've wondered if I needed to just move the email step to the end after each If Else as well, but that seems manual too (I'll have to write in the users email directly.. seems not correct?)
So I'm wondering if I'm just missing something obvious?
In the log step, I've also tried these fields to no avail:
{{issue.customfield_10215.displayName.fieldChange.toString}}
{{issue.customfield_10215.fieldChange.toString}}
{{customfield_10215.toString}}
{{#changelog.customfield_10215.displayName}}{{toString}}{{/}}
{{#changelog.customfield_10215}}{{toString}}{{/}}
{{fieldChange.toString}} did result in something, but it was showing me the changed value of Field X, when I need to access Field Y (customfield_10215)
When a rule edits a field, it is based on the issue's data at the current time, usually the time was rule triggered. The edited data is saved in the cloud, but not updated in the stored values within the running rule. (This helps with some use scenarios and yet can confuse rule writers.)
And so when you edited the field and then checked it afterwards, it had the original value.
When you want a rule to use the updated values, add a Re-fetch Issue action after the edit to refresh it:
Kind regards,
Bill
THANK YOU!!! This was exactly what I needed. The rest of the rule as I had it worked 100% after that. Appreciate you so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe it is the same scenario discussed here, can you please check this thread and see if the solution works?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it answers it, I still can't figure it out.
I am trying the tostring recommended, and nothing is showing at all in my audit log.
I've also read https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/ and https://community.atlassian.com/t5/Jira-Service-Management/How-do-I-compare-the-fromString-and-toString-for-just-the-parent/qaq-p/1512678 and neither of these are getting me closer :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to get some value to display for {{fieldChange.toString}}, however what it's doing is showing me the changed value for Field X (which is not being changed IN the rule itself), rather than the changed value for Field Y (which IS being changed in the rule itself and what I need to reference)
Field Y's field is customfield_10215, and these below yielded no result at all:
{{issue.customfield_10215.displayName.fieldChange.toString}}
{{issue.customfield_10215.fieldChange.toString}}
{{customfield_10215.toString}}
I even tried
{{#changelog.customfield_10215.displayName}}{{toString}}{{/}}
{{#changelog.customfield_10215}}{{toString}}{{/}}
And still nada
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.