Sub-task due date automation

Ryan McGee April 6, 2023

I have an automation to create a sub-task for certain events and have the due date set to: {{now.plusDays(3).toBusinessDay()}}. However, I want to add a rule to not exceed the due date of the parent. Maybe even have it 1 day prior to the parent due date. I am not a JQL expert, can this be done? 

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 6, 2023

Hi @Ryan McGee 

That seems possible with automation rules.  I am using Jira Cloud, and not Server/Data Center version, and so I cannot test the following for your tooling...

  • issues have some information about the parent, and the parent's data
  • try adding a condition to test {{issue.parent.duedate}} and adjust the subtask value accordingly...or...
  • you could use the math function min() to do try this:
{{#=}}MIN({{now.plusDays(3).toBusinessDay()}},{{issue.parent.duedate.minusDays(1)){{/}}

Kind regards,
Bill

Ryan McGee April 6, 2023

I will give that a shot!! Thank you! 

Like Bill Sheboy likes this
彥宏_Luke_ 劉 August 6, 2023

@Bill Sheboy May I ask your automation rule ? How did you set it !?

I really need it!!

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2023

Hi @彥宏_Luke_ 劉 

The specifics of the rule will depend on your scenario.  That is, which issue do you need to check / update.

If you look at the expression I wrote above you can see how to compare an issue's parent due date to the current date (adjusted).  To use that for an edit, type it in the edit field value, it will appear below the field, and then select it.

Kind regards,
Bill

Like 彥宏_Luke_ 劉 likes this
彥宏_Luke_ 劉 August 6, 2023

@Bill Sheboy 

Here is my automation rule , but it's not working.

May be the first value is fault?

PNG 20230806-2149_09.png

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2023

What is the field type for your custom field?  If they are not both date type I wonder if the comparison using isBefore() does not work as expected.  You can check this by writing the value to audit log (or checking the field configuration)

Another thing to try is to use the same format for the two fields (i.e., your custom field and duedate), and modify the comparison:

  • first value: {{issue.customfield_10023.jiraDate}}
  • condition: less than
  • second value: {{issue.duedate.jiraDate}}
Like 彥宏_Luke_ 劉 likes this
彥宏_Luke_ 劉 August 6, 2023

@Bill Sheboy It's working now!!!

I'm thanks you very much!!!

You safe my job😂

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2023

I am glad to learn that helped.  Please consider marking this question as answered; that will help others with a similar need find solutions faster.  Thanks!

彥宏_Luke_ 劉 August 6, 2023

@Bill Sheboy 
Please consider marking this question as answered "
>>I would love to do this, but this question is not open to me.
If possible, I have to open a new question, so that after you can answer, I will choose the correct answer to your question 😆

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2023

My mistake; I missed you had not raised this as a new question.  Please disregard my comment.

Like 彥宏_Luke_ 劉 likes this

Suggest an answer

Log in or Sign up to answer