I am new to Scriptrunner and I want to speed up the onboarding process by building some "persona" style scripts. For example,
User - "Project manager" requires "jira-user", "jira-software", "customer-share" groups
(I usually have 20-30 groups to add)
Is there a script I could use to run to add this in?
Thanks
David
// can run this example of getting the time in ScriptRunner console
// https://${MY_SERVER}/jira/plugins/servlet/scriptrunner/admin/console
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
IssueManager issueManager = ComponentAccessor.issueManager
Issue issue = issueManager.getIssueObject("TEST-9999")
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def result = changeHistoryManager.getChangeItemsForField(issue, "status").find {
it.toString == "Done"
}?.getCreated().getTime()
log.debug(result)
I'd like to figure this one out to. The problem is this:
I can make a scripted field to capture the date the transition was executed, and I'm all set for new issues.
However, my user just asked to get this populated on existing issues, which means poking through history.
I assume I need to build an array here and look for the last instance, but perhaps there is some more elegant way to do this.
Thanks
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.