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?
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.
It worked.
Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.