Forums

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

When a Story gets created with a custom date, its subtask needs the date minus 25.

Caleb Park
Contributor
December 11, 2023

Hi guys,

When a Story gets created with a custom date (for example, we call it "Delivery Date"), its child (Subtask) need to have Due Date which is Delivery Date minus 25 days.

For example, when a Story gets created with Delivery Date (12/31/23), then its subtask should have Due Date (12/6/23).

 

This is briefly what my automation looks like:

2.PNG

 

 

And in Subtask, I am trying to use this:

1.PNG

 

 

But when the subtask gets automatically created, its due date does not show at all. 

Am I getting a wrong formula for that?

How can I get the due date which is supposed to be Delivery Date - 25 days?

2 answers

2 accepted

0 votes
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.
December 11, 2023

Hi @Caleb Park 

I recommend first confirming the smart value for your field, Delivery Date.

Smart values are name, spacing, and case-sensitive.  And they often do not match the displayed field name on the Jira pages.  When an incorrect smart value is used, it will evaluate to null, and often fail silently with no errors in the log.

To confirm the smart value for your field, please use this how-to article: https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html

Kind regards,
Bill

Caleb Park
Contributor
December 14, 2023

Hi @Bill Sheboy

I noticed that there are two Delivery Dates in our field list, and it probably causes this issue.

So I am trying to use a smart value: {{triggerIssue.customfield_16173.value.minusDays(25)}}

 

But it is not still working.

If the custom field # is 16173, can you provide a clear solution to make it work using the specific custom field #?

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.
December 14, 2023

The value attribute is only needed if your custom field is a selection type, like a dropdown list.  What is the type of your custom field: text, date, date / time, etc.?

 

If your field is a date or date / time type, please try this first:

{{triggerIssue.customfield_16173.minusDays(25)}}

 

If that does not work, use this one:

{{triggerIssue.customfield_16173.toDate.minusDays(25)}}

Caleb Park
Contributor
December 14, 2023

Hey @Bill Sheboy 

{{triggerIssue.customfield_16173.minusDays(25)}} works!!

Thank you so much for your help!

Like Bill Sheboy likes this
0 votes
Answer accepted
Aaron Pavez _ServiceRocket_
Community Champion
December 11, 2023

Hi @Caleb Park 

In Jira Server/DC you first need to configure the sub-task due date. There are a couple of posts on how to do it:

Is there a way to display due date in subtask section?

Can you check if:

- Use the find my field and check if the Due date is visible

- Check if the Due date has been added to the proper screen

2023-12-11 17_53_56-Edit Issue _ CSJ-6 - Jira.jpg

If the automation is correct, it will work.

Regards

Aaron

Caleb Park
Contributor
December 14, 2023

Hi @Aaron Pavez _ServiceRocket_ 

Thank you for brining the idea up, but the Due Date is a custom field, not a system field, and the Due Date itself works fine.

Only problem is about the Smart Value formula.

I tried using 

{{triggerIssue.Delivery Date.minusDays(25)}}

and

{{triggerIssue.customfield_16173.value.minusDays(25)}}

But still no luck.

Aaron Pavez _ServiceRocket_
Community Champion
December 14, 2023

Hi @Caleb Park 

It seems the issue is the smart value. Try this one

{{triggerIssue.customfield_NUMBER.minusDays(25)}}.

If that doesn't work, check which Start date(there are several) you could be using and get the custom field number ID.

In my test, I used the same Due Date from the Story

{{triggerIssue.duedate.minusDays(7)}}

and it worked.

Make sure to use a DATE field instead of DATETIME.

Regards

Aaron

Caleb Park
Contributor
December 14, 2023

@Aaron Pavez _ServiceRocket_ 

Hey Aaron, thank you so much for the solution!

{{triggerIssue.customfield_NUMBER.minusDays(25)}} works!

I appreciate your help!

Suggest an answer

Log in or Sign up to answer