The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Need help with Automatization

Леонид
February 3, 2025

My trigger works on changing the task status. After which it should edit the task's custom field. I need the custom field to indicate the time it was in the "Sold" status. I don't understand how to implement this correctly.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Jovin
Community Champion
February 3, 2025

Hey @Лёня Криволапов 

There are a couple of ways to achieve this, I'll only cover the one that doesn't involve using APIs and parsing information like that.


  1. Setup a new custom field (you can name it differently):
    1. Date Sold: The date the task entered the sold status
  2. Setup the workflow to populate this information:
    1. Create a Post Function on all transitions INTO Sold
      1. Choose Update Issue Custom Field and then choose "Date Sold"
      2. Set the value to %%CURRENT_DATETIME%%
  3. Update your existing automation rule to now calculate the difference:
    1. Set the field "Time in Sold" (or whatever you've named it) to be the smart value below, note the the minutes|hours|days|weeks indicates you should choose the appropriate time span you want to use
    2. {{now.diff(issue.Date Sold).minutes|hours|days|weeks}}
Леонид
February 3, 2025

Thank you very much for the answer, I did it a little differently. My task was to display the time spent in each status approximately like this (3 days 2 hours 11 minutes). I created a trigger that, with any change in status, wrote it down in the custom field "Last status change". Command: {{now}}
Изображение WhatsApp 2025-02-04 в 10.39.04_a6e5b690.jpg
I created a trigger and a custom field for each state, but got stuck on the calculation.

Command:
{{issue.Time of entry into new status.diff(now).days}} days {{issue.Time of entry into new status.diff(now).hours.mod(24)}} hours {{issue.Time of entry into new status.diff(now).minutes.mod(60)}} minutes

The output is (1 days hours minutes) shows only days
Изображение WhatsApp 2025-02-04 в 10.39.44_01ed0e96.jpg
Please tell me where I went wrong.
And I apologize that my screenshots are in Russian, I hope this does not interfere.

Bill Sheboy
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 Champions.
February 4, 2025
TAGS
AUG Leaders

Atlassian Community Events