Forums

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

Date Field Calculation

Rich Douglass August 5, 2025

Hi,

I am evaluating JSM using the free edition. I created a form with custom fields and want to set the due date on a work item to be three days prior to the date of another field I called Start Date.

Using automation, I have the following, but it does not appear to work. What am I missing or is this the wrong approach for what I want to do?

{{issue.customfield_10015.minusBusinessDays(3)}}

This validates, but does not update the due date field for the work item. The automation is run on creation of the work item.

Thanks.

Rich.

5 answers

1 accepted

1 vote
Answer accepted
Rich Douglass August 7, 2025

Thank you all again for your help. It appears that the primary problem was that I was not linking a form field to a Jira field. Once I did that, things started coming together. 

For my purposes of setting up a demo environment to show to my team, I am good to go for now. There is a lot of depth to this product as I can see and the big question will be if it is too much for our small shop of six people that will be working the helpdesk.

Thanks again.

Rich.

2 votes
Marc - Devoteam
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, 2025

HI @Rich Douglass 

Whenever you ask for help with an Automation Rule it will help us to help you if you provide:

1. what type of project is this (e.g., company-managed, team-managed, etc.), 

2. images that show your complete rule.

3. images showing the details of any relevant actions/conditions/branches.

4. images showing the Audit Log details for the rule execution.

5. Explain where the issue is.

These questions are not for not willing to help, but to have community members understand on how automation works.

Marc - Devoteam
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 7, 2025

Hi @Rich Douglass 

So based on the provided information.

I think you are using the wrong Start Date field is this has no value.

Did you create this as a custom field or via the project on the request, that would mean you project is team managed.

Go to the cog wheel and choose the option Work Items, then select the option fields and find the field Start Date, is there more then one?

If there is, check the id's of the field, as the field with id 10231 is not used on the request you are making.

Then adjust the automation with the correct id and test.

Like Susan Waldrip likes this
2 votes
Trudy Claspill
Community Champion
August 5, 2025

Hello @Rich Douglass 

Welcome to the Atlassian community.

Please show us screen images of your entire automation rule, and the details of the step where you are trying to set the "due date" field.

There are multiple problems that could be occurring.

"customfield_10015" may not be the correct reference for the Start Date field you are using.

To confirm you have the correct field id, use the guidance in the following document to view the data in an issue that has the Start date field set.

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Search the output for the start date value you entered, and confirm that it corresponds to the custom field id you have used in your rule.

 

The "due date" field that you have specified in your Automation rule may not be the "due date" field in use in your project. Have you picked that field from the Choose fields to set list in an Edit action? Was there more than one field named 'due date"? Did you choose the one that matched the field label you see in the issues; i.e. "Due date" vs. "Due Date"?

You can use the same procedure above to view the data in an issue where your "due date" field has been set.

 

Is your "Start Date" field configured as a Date or Date/Time field or some other field type? Is it the same type as the "due date" field you're using?

Trudy Claspill
Community Champion
August 6, 2025

Hello @Rich Douglass 

Thank you for that additional information. It is very helpful.

Following the Create Issue action the focus of the rule is not automatically shifted to the issue just created. All the actions after that in your rule are currently referencing the trigger issue where you use {{issue}} and the Edit action is operating against the trigger issue.

In the Log action if you want to print out the values in the newly created issue you can use the {{createdIssue. instead of {{issue.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--createdIssue--

 

Do you want the Edit action to apply to the issue from which the rule was triggered, or to the issue you create within the rule?

How are you getting input from the user? Have you configured your Manual Trigger to accept User Input?

In which step are you using the user's input? Please show us the details of that step.

 

On a side note, if you are new to working with Automation Rules you may want to take advantage of the free, on-demand training on that topic that can be found through the Learning link at the top of the Community pages.

Like Susan Waldrip likes this
0 votes
Rich Douglass August 6, 2025

Thank you all for your responses. I hope I get all the info you need to help me. I am a newbie with this, so please bear with me.

I want to update the Due Date field when a work item is created based upon the Start Date that is entered by the user. Both fields are of Date type. One thing I am seeing is that when I output the field values to the log, I get nothing for the date, yet the Start Date shows in the work item view.

The smart value for the field is the same in the JSON as when I create the step to update it:

Field Name.jpg

The rule is now trimmed to the following:

Automation Rule.jpg

The calculation should subtract 3 BD from the Start Date and put it in the Due Date:

DueDate.jpg

The log says everything is fine:Log.jpg

Hopefully this is all you need. If you need additional details, please let me know. I can see the power of what the automation can do for me if I can get this example to work.

 

Thanks again.

Rich.

 

 

 

0 votes
Nate Whitehead
Contributor
August 5, 2025

If you add a "Log Action" step with that value, what do you get in the log?

 

Suggest an answer

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

Atlassian Community Events