Skip to content

Instantly share code, notes, and snippets.

@atombrella
Created September 24, 2021 16:57
Show Gist options
  • Save atombrella/fa645d3a2d84bbc07ac30f7a93fdc095 to your computer and use it in GitHub Desktop.
Save atombrella/fa645d3a2d84bbc07ac30f7a93fdc095 to your computer and use it in GitHub Desktop.
Fetch Issue in Script Console
@com.onresolve.scriptrunner.parameters.annotation.ShortTextInput(description = "Enter Jira to execute the script on - leave empty for non-debug modes", label = "Jira Request Issue")
String jiraDebugIssue
Logger logger = Logger.getLogger("sacos.s5k.evalcreate")
logger.setLevel(Level.ALL)
IssueService issueService = ComponentAccessor.getIssueService()
IssueManager issueManager = ComponentAccessor.getIssueManager()
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
ProjectManager projectManager = ComponentAccessor.getProjectManager()
WatcherManager watcherManager = ComponentAccessor.getWatcherManager()
IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager()
OptionsManager optionsManager = ComponentAccessor.getOptionsManager()
Issue issue // enable this line for editor to function correctly
if ( jiraDebugIssue != "" ){
issue = issueManager.getIssueObject(jiraDebugIssue) // Add an issue for testing
logger.setLevel(Level.ALL) // ALL, WARN
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment