Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a subtask 30 days after completing the previous one

Мария June 27, 2023

Good afternoon.

My condition is to create a subtask "delete the server" 30 days after completing the previous subtask "turn off the server" (this subtask is created using automation), these subtasks have one parent. I'm trying to do this through jira automation, but it doesn't work for me.

In jql, I specify the following expression: project=“AS” and summary ~ “Turn off the server” and issutype= “Subtask_as” and resolved <= 30d


By this expression, subtasks completed more than 30 days ago are found. But it does not create a new subtask.

Please help me solve this problem. Maybe there's another way.

 

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
June 27, 2023

Hello @Мария 

Please show us the complete automation rule you have constructed. We can't advice you on why it is not working without that information.

Also please show us the output in the rule Audit Log for an execution of the rule where you did not get the results you expected.

Мария June 27, 2023

Automation is triggered if I make changes to any field. If the task just went through the business process and got into "completed", then audit log reports - no actions performed.IMG_7822.jpegIMG_7831.jpeg

Trudy Claspill
Community Champion
June 28, 2023

Based on your screen images it appears that you are using Jira Server or Jira Data Center. Is that correct?

The message, along with the settings in your rule Trigger, explain your issue.

Your rule Trigger has the box checked to include only the issues that have changed since the last time the rule ran.  The message says no issues have change since the last time the rule ran. So your rule is not executing any actions.

Do you have subtasks that match the JQL in your trigger where those subtasks have been changed since the last time the rule ran?

Мария June 29, 2023

Good afternoon. I need this checkmark because I don't need automation to create subtasks in parent tasks where they have already been created before. Every day we create and execute subtasks "Turn off the server". The transition of a task in a business process from a new one to completed, is it considered an update of the task??? Example: the last execution of the rule was on 06/24/2023, today there is a task with a solution from 05/29/2023 (30 days from the date of the solution), the rule should work today on 06/29/2023, but it does not work on this task, apparently it does not see any changes on it…  although the jql filter defines this task.IMG_7848.jpegIMG_7851.jpegIMG_7850.jpeg

Мария June 29, 2023

I intentionally additionally made changes to the AS-792 subtask on 06/24/2023, and it's still invisible for automation(((

Trudy Claspill
Community Champion
June 29, 2023

Can you share with us the full JQL statement in your Trigger?

The trigger will retrieve only the issues where the Updated Date of the issue is newer than the last run of the automation rule. 

If you want a new subtask created 30 days after another subtask has closed, and the closed subtask does not undergo some sort of update since the last time the rule ran, then this rule will not work.

You will need to remove the checkmark from the rule trigger.

Then I recommend that you update the JQL in the trigger with this criteria:

AND resolutiondate >= startofday(-31) and resolutiondate <= endofday(-30)

That will give you the issues closed on just the one day, 30 days ago. If the subtask was closed more than 30 day ago or less than 30 days ago, then it will not be included in the result set returned by the trigger.

I recommend that you test the JQL in the search screen before using it in the actual execution of the rule, and check the Resolved date of the returned issues to confirm that they are indeed the ones for which you want to create a new subtask.

Мария June 30, 2023

OK, I'll test the filter you suggested.

I used it like this:

project=“AS” and summary ~ “Turn off the server” and issutype= “Subtask_as” and resolved <= -30d

or 

project=“AS” and summary ~ “Turn off the server” and issutype= “Subtask_as” and status = «completed» and status changed to «completed» before -30d

Мария July 21, 2023

@Trudy Claspill 

Good afternoon, Trudy.
I would like to add that when allocating one day for tasks created later than 30 days, but not earlier than 30 days, in the solution that you proposed, filters tasks correctly, but automation on it works 2 days in a row for the same task, I attached an example below. So I replaced the expression with this:


And resolution date >= startofday(-30) and resolution date <= endofday(-30)


In this case, the tasks created exactly 30 days ago are selected, and the next day the automation does not work on the same task again, as it happened with me earlier.

IMG_7931.jpeg

Like Trudy Claspill likes this
0 votes
Мария July 2, 2023

@Trudy Claspill 

Thank you very much for your help, the search for your proposed jql works correctly! That's what I needed.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events