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

Automation that will count numbers in the fields (and more)

Artur April 22, 2024

Hello everyone!

We would like to create automation that will make some math operations when it comes to filled fields. 
So, just a little background - we already have existing fields, and we don't want to change them/edit as this could impact all the existing tickets. Therefore, we would like to add a new field that will do all the counting.

So:

 

1. The reporter is required to add a specific digit number in the field "How many months should this apply for";

2. There is a new field - let's name it "How many days?"

3. We would like to transition months from "How many months should this apply for" to days and add it to the new field from point 2;

4. Furthermore, we would like to add days when the ticket was closed (transitioned to completed status);

5. Automation should work on a daily basis, checking all the existing tickets and do the above;


For example:
Ticket was closed on 22/03/2024 (this mean it's 30 days);

This should apply for 6 months (180 days);

Therefore, I would like this field to show 180 days + 30 days = 210 days.

So far, I manged to figure out  how to transition monthly fields to days by using the following: 
{{#=}}{{issue.customfield_x}}*30{{/}} 
but I have yet to figure out how to combine those with when the ticket was closed.

Could you please assist?


Thank you!

1 answer

0 votes
Kalyan Sattaluri
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.
April 22, 2024

Hello @Artur 

To calculate how many days ago an issue was closed, you can use: {{issue.resolved.diff(now).days}}

 

To add this to your existing count, you will use:

{{#=}}{{issue.customfield_x}}*30 + {{issue.resolved.diff(now).days}}{{/}} 

And why not set up a trigger = issue transitioned to "Done or whichever statuses" and then update your new field with above smart value?

Artur April 22, 2024

Hey @Kalyan Sattaluri ,

Thank you so much!

Yes, we may consider this in the future, but for now we need to identify and update older tickets.

I tried your suggestion and unfortunately, I got an error:

 

"Error rendering smart-values when executing this rule:

Missing parameter(s) for operatora +:10.0*30+ "

Kalyan Sattaluri
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.
April 22, 2024

Please share a screenshot of your rule and copy paste your syntax as well.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events