Hello,
I am trying to build an automation to automatically transition a new issue to Canceled status if the Target Date field value equals the issue create date. I use Jira Service Management Data Center.
I can get the automation to work for all created tickets or none at all, but not for the conditions I need.
Here is my current version:
When: Value changes for Target Date
If: Customer Request Type equals Branch Rate Match Request
And: Compare two values: Checks if {{issue.customfield_13901-val}} equals {{issue.Created-val}}
Then: Transition the issue to Canceled
This version works for tickets when the Target Date = Created Date and when it does not equal. For my test issue, I entered 4/1/2024 in the Target Date field, with the Created date as 4/10/2024. The Audit Log says this matched the Condition: Compare two values.
Can you advise on how I can set this automation so that it only auto-transitions when the fields truly match?
Thanks!
Here is a screenshot of my rule and audit log.
Take off the -val on the two fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I removed the -val and created a test issue, with Target Date: 4/10/2024 and Create Date: today (4/10/2024). But the status did not auto transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's probably including the time. Maybe try .jiraDate on the end of each date field.
{{issue.created.jiraDate}} for example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, John. Another strike out. I completed the same test - new issue with Target Date and Create date as 4/10/2024.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Bridget Caci
Please insert a log statement before your compare and log both values and share the audit log.
{{issue.customfield_13901.jiraDate}} equals {{issue.Created.jiraDate}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like there is a typo in your code. Try to page in Kaylan's example. Also you might need to put Created as created (lowercase) as it is case sensitive sometimes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't inserted a log statement before, so please let me know if I need to make changes. As I have it written, it did not auto transition when I tested.
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.
Hello @Bridget Caci
As @John Funk has mentioned, you have a typo in your compare of If condition :p
Please revise it to:
{{issue.customfield_13901.jiraDate}}
And you did great with the log. Always log values so you know what values they hold.
Hope it helps and accept answer so it benefits others in the future. Thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is perfect! This is exactly what we needed - adding the log statement and fixing the typo. We ran several tests and it worked properly each time.
Thank you all so so much for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! Glad it worked out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bridget,
Can you share the actual rule? That will help us to troubleshoot it.
And also the details of the audit log when it runs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
It seems the two dates comparing is not correct:
And: Compare two values: Checks if {{issue.customfield_13901-val}} equals {{issue.Created-val}}
Thanks,
YY哥
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to our community. Please try it and refer to this link for more details:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
Hope it helps. Thanks,
YY哥
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.