Forums

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

Create table in JIRA dashboard of overdue vs ontime issues in Current Sprint

Anushree Athawale
October 17, 2023

Hi, 

I want to create a single table in a dashboard where I can get:
Total issues in each sprint 

Overdue issues in each sprint.

On time issues in each Sprint.

Please suggest possible solutions.

1 answer

1 accepted

0 votes
Answer accepted
Joshua Yamdogo @ Adaptavist
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.
October 24, 2018

Hi Nico,

'users' is a list of user objects, yes? You won't need to use the userManager because 'it' is already going to be a user object. Also, I think you have to set the Approvers field with a list of users. See if this script works

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.link.IssueLinkType

for (it in users) {
log.debug "Users loop STARTED"
def newIssue = issueFactory.cloneIssue(issue)

newIssue.setSummary("DETAIL - $issue.summary")
newIssue.setProjectId(issue.projectId)
newIssue.setDescription(issue.description)
newIssue.setAssigneeId("$it")
newIssue.issueTypeId = "10200"
log.debug("Assignee: " + it.name)

log.debug("Approver: " + it.name)

newIssue.setCustomFieldValue(customFieldManager.getCustomFieldObject(10100), [it])

Map<String, Object> newIssueParams = ["issue": newIssue] as Map<String, Object>
//issueManager.createIssueObject(currentUser, newIssueParams)
issueManager.createIssueObject(currentUser, newIssueParams)

IssueLinkManager linkManager = ComponentAccessor.getIssueLinkManager()

log.debug("Issue Link Types : " + IssueLinkType)
linkManager.createIssueLink(issue.getId(), newIssue.getId(), 10003, 1, currentUser);

log.debug "Users loop END"
}

Regards,

Josh

Nico Hoffmann
October 25, 2018

Hey Josh, 

you did it! :-) I tried your line and it works like charm! 

Thank you very much and a nice weekend for you!

Best regards, 

Nico

Joshua Yamdogo @ Adaptavist
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.
October 25, 2018

Hi Nico,

Glad to hear you got it working! :)

Thx for using ScriptRunner.

Regards,

Josh

Suggest an answer

Log in or Sign up to answer