I am trying to make a ticket route itself. Employees are going to open a ticket to project time off. I want the status to automatically change to “In Progress” when their projected start date occurs, and then transition to Resolved when their estimate return has occurred. I want it to wait 5 days and then transition to Closed. The user fills out a two fields, “Target Start” and “Target End” when creating the ticket
Upon creation I have the following rules:
Target Start copies to >> Planned Start
Target Start copies to >> Start Date
Target End copies to >> Planned End
Target End copies to >> Actual End
How do I make this happen?
Hello @Andrew Scraper
Welcome to the Atlassian community.
You can do all that with Automation Rules that use a Scheduled trigger. Are you familiar with the Schedule trigger in Automation Rules?
https://support.atlassian.com/cloud-automation/docs/jira-automation-triggers/#Scheduled
I would recommend 3 rules, with each one scheduled to run once daily.
Within the trigger you can specify a JQL statement to select the issues you want to transition.
1. I want the status to automatically change to “In Progress” when their projected start date occurs
"Target Start" = {{now.jiraDate}} and status!="In Progress"
2. transition to Resolved when their estimate return has occurred
"Target End" = {{now.jiraDate}} and status="In Progress"
3. wait 5 days and then transition to Closed
"Target End" = startOfDay(-5) and status="Resolved"
Let me know if that is enough information for you to proceed, or if you have additional questions.
Thank you! Your guidance was exactly what I was looking for and needed. This is now going to be used for employee traveling.
This is what I have done:
I was concerned with status boxes being global so I created new ones that fill the same function.
Workflow now looks like this:
User creates ticket >>> “HD: TR: Request Received” >>”HD: TR: In Transit”>>” HD: TR: Travel Finished”>>”Closed”
What worked:
In automation:
When Scheduled
Midnight New York US
JQL>>> "Target Start" <= {{now.jiraDate}} and status != "HD: TR: IN TRANSIT" and status = "HD: TR: REQUEST RECEIVED"
VVVV
Then: Transition the issue to: “HD:TR: IN TRANSIT”
Including these lessons learned here for the next administrator trying to implement something like this:
Things that did NOT work:
I had to change "Target Start" = {{now.jiraDate}} to "Target Start" <= {{now.jiraDate}}
Why? The date was in the past, it was not equal.
Also, I had to toggle off “Only include issues that have changed since the last time this rule executed” in scheduled. The reason: Issues were not changing between scans. It would be scanned once, it would be before the start date, and then the scan would skip scanning that issue.
Also, I tried a multistep approach:
In automation:
When Scheduled: Midnight New York US
VVVV
IF: Status Equals=“HD: TR: Request Received”
VVVV
AND: Issue matches JQL >> "Target Start" = {{now.jiraDate}} and status!="HD: TR: In Transit"
VVVV
Then: Transition the issue to: “HD:TR: IN TRANSIT”
Why? It seems that Jira needed me to use JQL in “Scheduled” and that an “If” could not follow. I received the following error regarding the If statement:” Incompatible components”. See attached picture.
Things I will be revisiting because I don’t know if this would be impactful: Save processing time and resources by putting a label on the ticket upon creation. Use that label so that the rule only scans incidents with that label.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Andrew Scraper
The Incompatible Components warning sometimes comes up when it should not. There have been a few posts in this community about that. The rule should work with the Condition after the trigger as long as the trigger is using a JQL to select issues.
You should not need the Issue matches JQL condition if you have the JQL in the Scheduled trigger.
You did say you wanted it to transition on the date, not transition earlier than the date.
Another way to write a JQL to transition the issue when Target Start is today is this:
"Target Start" >= startOfDay() and "Target Start" <= endOfDay()
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.