Forums

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

Set a Follow Up Due Date based on the current date plus a number from a custom field.

Todd Skelton June 4, 2024

I'm trying to set a future follow up date based on the value in a numeric custom field added to the current date

 

Currently, I have my Edit field automation step set as follows in order to set a custom field called Follow Up Date: {{now().plus(issue.customfield_10402)}}

 

But this always returns "None". 

 

Any ideas what I'm missing?

 

.   

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.
June 4, 2024

Hi @Todd Skelton 

The current date / time function is {{now}} and not {{now()}} and your date increment is missing the units of measure, such as plusDays() 

Please look here for examples of the syntax to increment a date / time value: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-plus-unit---

Kind regards,
Bill

Todd Skelton June 4, 2024

Thanks.   I can get that to work if I just hard code a number of days in the JQL, but If I want the number of days to come from a custom numeric field it doesn't update my Follow Up Date field.

 

{{now.plusBusinessDays(issue.customfield_10402)}}  leads to no update.

 

{{now)).plusBusinessDays(issue.customfield_10402)}} just updates to today's date. 

Todd Skelton June 4, 2024

Follow up date.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.
June 4, 2024

What is the type of your field, customfield_10402?

If it is text, please add asNumber to convert it inside of the function call:

{{now.plusBusinessDays(issue.customfield_10402.asNumber)}}

 

If it is something else, please post an image of the audit log details showing the rule execution.  That my provide more context for what is happening.

Todd Skelton June 4, 2024

Hi Bill, it is a number field.  The audit log says it's editing the value successfully, but it doesn't.  I also tried it as a text field.   As a text field the number got rendered as 2.0.

Thanks again

follow up date audit log.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.
June 4, 2024

Please try writing that custom field to the audit log to confirm it contains what you expected when the rule runs:

Field contains: {{issue.customfield_10402}}

 And what type of field is the custom field "Follow Up Date": a date picker or something else?

Todd Skelton June 5, 2024

Thanks.   Follow Up Date is a date picker.   Here's the actions logged for both the Days Until Next Follow Up and Follow Up Date fields.   

 

Days Until Next Follow up is showing as 5.0 and the rule isn't successfully setting the date field based on the current date plus the daysFollow up date audit log 2.PNGFollow up date JQL.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.
June 5, 2024

This is quite curious...

Have you confirmed that the field "Days Until Next Follow up" is in fact customfield_10402?

Have you tried using the user input directly to see if you get the same result?  Perhaps try writing this to the audit log:

now plus user input: {{now.plusBusinessDays(userInputs.followupdays.asNumber)}}
Todd Skelton June 5, 2024

Thanks Bill.   The issue was indeed that I had transposed the custom field number.  Fixed that and it's working as I wanted it to!

 

Thanks a bunch for your help!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events