Forums

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

Trying to either create a button or automation to calculate End Date for a project.

Ashish Dobriyal
Contributor
November 21, 2023

I have the following Custom Fields:

Start Date

End Date

Step 1 (Days)

Step 2 (Days)

Step 3 (Days)

Step 4 (Days)

Start Date I have a button which does that. End Date I want it to calculate based off days I have in Step 1-4 and add it to the Start Date, so if my Start Date is November 21 and Step 1 takes 1, step 2 takes 1, step 3 takes 1 and step 4 takes 1 day then my end date should be November 25 (4 days), is there a way to make a button or automation to be able to this.

 

2 answers

1 vote
Hannah Humbert - Simpla Workflows
Community Champion
November 21, 2023

@Ashish Dobriyal yes this should be possible! I'm not sure if you can achieve this all within one rule though (someone else might prove me wrong though!). You might need to create another "total" field then use butler to calculate the total duration (see custom field arithmetic here).

Then use date arithmetic to add this number to the start date. E.g. 

when custom field "Total" is set, set custom field "End Date" to "{{%Start Date}+{{%Total}}d}”
0 votes
Daydreamer Mike
Community Champion
November 21, 2023

Hi @Ashish Dobriyal 

Try

Set custom field "End Date" to "{{%Start Date}+({{%Step 1 (Days)}}+{{%Step 2 (Days)}}+{{%Step 3 (Days)}}+{{%Step 4 (Days)}})d}
Ashish Dobriyal
Contributor
November 22, 2023

When I try creating the button, it doesn't let me choose End Date as a Custom Field, I can't choose anything that's a Date. I'm assuming the trigger is Set Custom Field "End Date" to new value and that's the rest of what you said.

Hannah Humbert - Simpla Workflows
Community Champion
November 22, 2023

@Ashish Dobriyal I believe it's a dropdown field, but you should be able to type the field name as well. Just make sure you spell it word for word. 

Ashish Dobriyal
Contributor
November 22, 2023

I typed in the field name and I added this formula for the new value:

"{{%START DATE}+({{STEP 1}}+{{STEP 2}}+{{STEP 3}}+{{STEP 4}}+{{STEP 5}}+{{STEP 6}})d}

When I look at the formula in Create a button page there is a \ added before Start Date:

set custom field "END DATE" to "\"{{%START DATE}+({{STEP 1}}+{{STEP 2}}+{{STEP 3}}+{{STEP 4}}+{{STEP 5}}+{{STEP 6}})d}"

When I click the button I get the following error:

Couldn't read a date in ""{{%START DATE}+({{STEP 1}}+{{STEP 2}}+{{STEP 3}}+{{STEP 4}}+{{STEP 5}}+{{STEP 6}})d}".

I did change custom fields name from my initial questions so these are the exact names of the fields word for word.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events