How to count the number of days an issue has been assigned to an assignee in a custom field in Jira

Edgardo Ibarra
Contributor
October 3, 2023

Her everyone! 😌

I'm trying to create an automation in Jira that will track the number of days an issue has been assigned to an assignee in a custom field. I've been able to create the field, but I'm not sure how to calculate the number of days.

I'm thinking of using the following expression:

 

now() - issue.fields.created OR now() - issue.fields.assigned

Can anyone help me with this please?

I'm using JSM and this is the current automation that doesn't works as I need:

Screenshot 2023-10-03 at 10.54.10.png

3 answers

2 accepted

2 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 3, 2023

Hi @Edgardo Ibarra 

I would use two automation rules/custom fields for this:

  • Rule #1: Timestamp when the issue was assigned. For my example I'll use a field called Assigned Date
  • Rule #2: Set the number of days since assigned (Dias en Gestion)

RULE #1

When the Assignee field is changed, set the Assigned Date to now

  • TRIGGER: Field Value Changed (Assignee)
  • ACTION: Edit Issue (Assigned Date)
    • {{now}}

RULE #2

This rule will run on a schedule to update all open issues 

  • TRIGGER: Scheduled
    • resolved IS NOT EMPTY
  • ACTION: Edit Issue (Dias en Gestion)
    • {{issue.Assigned Date}}.diff(now).days}}

Note - you can substitute days for businessDays if you want a more accurate reflection of how many days an issue has been assigned

Edgardo Ibarra
Contributor
October 4, 2023

Hey Mark! 

Thanks a Million! This really helped me with what I need. 

Have a great week! 

Like Mark Segall likes this
0 votes
Answer accepted
Emre Toptancı _OBSS_
Atlassian Partner
October 4, 2023

Hello @Edgardo Ibarra,

Building a custom automation will most likely be hard to build and maintain. So it will be expensive. I suggest you use a marketplace app for that.

Our team at OBSS built Time in Status exactly for this. It is available for Jira Server, Cloud, and Data Center.  

Time in Status mainly allows you to see how much time each issue spent on each status or each assignee

tisCloud_StatusDuration_LeadTime_with Estimates.png    tisCloud_AssigneeDuration.png

The app also has Status/Assignee Composite Reports that can show assignee times broken down to statuses or vice versa.

tisCloud_AssigneeDurationPerStatus.png  tisCloud_StatusDurationPerAssignee.png

For all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total in-progress time per customer or average resolution time per sprint, week, month, issuetype, request type, etc. The ability to group by parts of dates (year, month, week, day, hour) or sprints is particularly useful here since it allows you to compare different time periods or see the trend. 

tisCloud_StatusDuration_LeadTime_Average_TimeGrouped.png

The app calculates its reports using already existing Jira issue histories so when you install the app, you don't need to add anything to your issue workflows and you can get reports on your past issues as well. It supports both Company-Managed and Team-Managed projects for Jira Cloud.

Time in Status reports can be accessed through its own reporting page, dashboard gadgets, and issue view screen tabs. All these options can provide both calculated data tables and charts.

Gadget_AverageStatusDurationByComponent.png  tisCloud_StatusDuration_LeadTime_Chart.png tisCloud_IssueView_Data.png

https://marketplace.atlassian.com/apps/1211756/

EmreT

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
October 3, 2023

Hi @Edgardo Ibarra

If you consider using a marketplace app, you can try Status Time Reports app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status.

Here is the online demo link, you can see it in action and try without installing the app. For your case, you can have a look at Time in Assignee report. For further details, please check Status Time Reports How to Videos.

  • This app has a dynamic status grouping feature so that you can generate various valuable reports as time in status, time in assignee, status entry dates and status counts, cycle time and lead time, average/sum reports by any field(e.g. average in progress time by project, average cycle time by issue creation month).
  • You can search issues by Project, Issue Type, Status, Assignee, Issue Creation/Resolution Date(and any other Date field) and JQL Query.
  • Status durations are calculated according to the working calendar you define. Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days.
  • You can set different duration formats.
  • You can export reports in CSV file format and open them in MS Excel.
  • You can also add this app as a gadget to your Jira dashboards and reach “Status Time” from Issue Detail page.
  • You can enable/disable access to Status Time reports&gadgets and Issue Detail page per project, users, groups or project role.

If you are looking for a completely free solution, you can try the limited version Status Time Free.

Hope it helps.

Edgardo Ibarra
Contributor
October 3, 2023

thanks

Like Mehmet A _Bloompeak_ likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events