Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Hello! I am attempting to create an automation for the subtraction of one custom field from another.

Samantha Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 17, 2024

I am trying to create an automation that calculates a date in an issue field from subtracting a number in a custom field from a date in another custom field. 

 

I can't seem to get the automation to work since one of my custom fields is just a text field with a prepopulated number that is our process lead time (varies on each card in Jira board). 

I need an automation that gives me my Due Date that equals my Purchasing Need By Date (10041) minus my Lead Time (10071). The lead time needs to be expressed in business days though. 

 

Is this possible?

1 answer

0 votes
Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2024

Hi @Samantha Johnson 

welcome to the community and thank you for your question.

You should be able to convert the string from the text field to a number with the following syntax:

{{issue.YOUR FIELD.asNumber}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#asNumber

If it still does not work, please make sure to post a screenshot of your rule, so we can dig deeper.

Samantha Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 17, 2024

So I have 2 custom fields. 

The first is called "RO RMT Process Lead Time", ID 10071. This field is already hardcoded into each card and is a set value though it differs for each product. 

The second in called "Purchasing Need-By Date", ID 10041. This field is entered manually by the person creating/editing the card. 

 

I need an automation to trigger when the card is moved to a specific column which is easy enough. 

The automation needs to update the "Due Date" field to equal "Purchasing Need-By Date" minus "RO RMT Process Lead Time". I need the lead time expressed as business days. So the example below shows a lead time of 13 but it is really 13 business days.

So using the info from the card below I would need 13 business days subtracted from 5/31/2024 and that resulting date populated in the "Due Date" field.

I have tried a handful of different variations now but this is the latest one I just tried and failed. 

 

{{issue.customfield_10041.minusBusinessDays(issue.customfield_10071.asNumber)}}

 

2024-05-17_16-23-26.jpg

 

2024-05-17_16-08-19.jpg2024-05-17_16-08-01.jpg

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events