Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to work out the date Difference

Hi,

 

Just looking for some help.

What I am wanting to do is work out the Number of days a quote has been submitted for against the current date.

 

I have a custom Field set up called (Date Quote Was Submitted By Brexons). 

With this we would then like to automatically work out how many days on a rolling day to day basis it has been submitted. 

 

Example: 

Date Quote was submitted (03/01/22)

Todays Date (06/01/22)

Number of Business days (3) - This would then go up in value as each day passes but only for business days. 

 

Would this be possible to do and if so, any help to achieve this would be greatly appreciated. 

1 answer

1 accepted

0 votes
Answer accepted

Hi @Matthew Hardy ,

With a automation rule it is possible I think.

I've made a rule for the difference between two fields and uses the following in additional fields:

{

    "fields": {

        "Time To Market": "{{#issue.customfield_11500}}func=businessDaysBetween({{issue.customfield_11501}}), format=\"toDays\"{{/}}"

    }

}

 
Is this useful to you?

Regards, Marco

Hi @Matthew Hardy 

Adding to Marco's idea, you could do this for time-to-current date/time with this:

{{issue.Date Quote Was Submitted.diff(now).businessDays}}

Please check your field name to confirm the smart value.  And, this assumes business days are Monday to Friday, 9am to 6pm.

Kind regards,
Bill

Like # people like this

@Bill Sheboy @Marco Brundel 

Thank you both for your response.

 

Sorry I am new to this. To achieve this would I need to create another custom field for the number of days to go into?

 

Further more, which trigger would be the best one to use when creating the automation rule and then for the action would it be "Comment on Issue"

 

Again thank you both for your help and sorry to be a pain. 

Hi @Matthew Hardy 

What do you want to do with that value for the number of days?  For example, if you wanted to report/filter on it, you could calculate it with an automation rule and then store it in another custom field.

Regarding the rule trigger, you could check on a change to your "Date Quote Was Submitted" field, such as:

  • trigger: your date field changes
  • action: edit issue to store the calculated days in another custom field

Here are some automation references and examples to help you get started:

If you have challenges doing this, please post images of your rule and audit log so the community can help.

Like # people like this

Hi @Bill Sheboy 

 

Yeah we are wanting it to report on. We are using this to track to see how long the quote has been submitted for since being submitted as we will use this information to track our 75 Day quote period. 

 

The second custom field which is called "Number of Days Since Quote was Submitted". I have done this as a numbers field due to it just requiring a number in there.

 

I have attempted the automation rule and its run successfully however it doesn't fill in the empty custom field. Is there something I am doing incorrectly. 

 

Screenshot 2022-01-11 093703.pngScreenshot 2022-01-11 093715.pngScreenshot 2022-01-11 093734.png

Matthew, I think you may have the incorrect name of the smart value for your field in the edit expression.

Please use this how-to article to find the exact smart value for your field: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Basically you find an example issue with your field, and then call the REST API from a browser tab.  That will show you what to use in the rule.

Like # people like this

@Bill Sheboy 

 

Thank you, I have managed to get this working now thanks to your help. Really appreciated. 

 

Thanks,

 

Matt

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

810 views 24 28
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you