Forums

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

How to time track all tasks in JIRA?

Lukasz
April 26, 2023

I would like to keep time tracking of all issues added to JIRA board. 

We have time tracking enabled but I couldn't find any widgets in the Dashboard panel to calculate total time spent or time spent on task/epic.

 

How to do it?

2 answers

1 accepted

0 votes
Answer accepted
Marcos Sanchez
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.
June 11, 2018

Hi,

You forgot to "save" the issue changes. Furthermore, your code could be optimized.

This code could work for you:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption

def customFieldManager=ComponentAccessor.getCustomFieldManager()//Customfieldleri cagirmaq ucun customfieldManager yaradiriq
def issueManager = ComponentAccessor.getIssueManager()

def customerRequestType=customFieldManager.getCustomFieldObjectByName("Customer Request Type")//Customer Request Type
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

/*
If you want to set the user that modifies the description, replace the "def user" line with this:

def userManager = ComponentAccessor.getUserManager()
def user = userManager.getUserByName(here goes the username of the user you desire)

Otherwise, it will use the user that is logged in the moment of the execution
*/

def issCRT=issue.getCustomFieldValue(customerRequestType)

if(issue.getIssueType().name=="Stamp Request" && issCRT.toString()=="ad/badc2549-b904-4312-99a6-d7e2b9a0d31f"){
def stamp=customFieldManager.getCustomFieldObjectByName("Stamp")//Stamp CustomField-ni tapir
def IssStamp=issue.getCustomFieldValue(stamp)//Issuedaki stampin qiymetin tapir

issue.description = issue.description+IssStamp.toString()
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
}

 

Hope it helps.

 

Regards,
Marcos.

Jamil Rahimov
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.
June 11, 2018

It worked.
Thank you very much.

0 votes
Jamil Rahimov
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.
June 10, 2018

script.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events