I created below rule [Custom] When a Subtask is Done → Subtask greater than 2 days old will be moved to Closed state. 48 hours duration is not being considered. As soon as the subtasks are done, they are moved to closed state w/o considering duration.
Anything missing in my rule?
@Shirley Setpally , so what does the updated field actually display when the rule is run? Does it show <48h ago?
Hi @Shirley Setpally -- Welcome to the Atlassian Community!
Does this match your use case:
If so, please consider changing your rule to periodically check for issues meeting this criteria using a Scheduled trigger and JQL, and then perform the last transition. For example the JQL for the trigger could be:
project = myProjectName AND issueType = Subtask AND status CHANGED FROM "Code Review" TO "Done AND updated < -48h
Also please consider if issues could be updated for other reasons that would impact the 48h check you wanted. If so, you could instead use statusCategoryChangedDate for your check:
project = myProjectName AND issueType = Subtask AND status CHANGED FROM "Code Review" TO "Done AND statusCategoryChangedDate < -48h
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Agree here that was my first thought but I have never actually played with the condition @Shirley Setpally was illuminating and am interested in how it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Bill, this did not work
I tried for querying just the done subtasks from issue tab, don't see any results
project = myProjectName AND issueType = Subtask AND status CHANGED FROM "Code Review" TO "Done
Also how can i use this query to create a rule?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shirley, did you substitute in your own project name where I put the placeholder: myProjectName?
Once you have a query that works, you could create a rule with a Scheduled trigger running every 48 hours with that JQL, and then transition the issues as you noted earlier.
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.
Hmmm...let's break this into pieces to see what is happening.
First try this query standalone in advanced issue search, to confirm there isn't some variation of another issue type name "subtask":
If that works, try to find any issues which transitioned from "Code Review" to "Done":
If none were returned that were subtasks, that is the issue.
If none were returned at all, then no issues made that transition from one status to another...or...those are not matching your status value names.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Shirley Setpally and welcome to the community!
Looking at your automation, it appears that when subtasks are moved to done and updated is after 48 hours it tries to move to done again.
I'm assuming you want this to impact a different subtask. In this case, you'd need a branch component. Assuming you're looking for other subtasks sharing the same parent, you could do a branch based upon JQL like this:
parent = {{issue.parent}} and key != {{issue}}
Then move those last two components under the new branch.
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.