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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nico,
Glad to hear you got it working! :)
Thx for using ScriptRunner.
Regards,
Josh
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.