You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am using Scriprunner to do this, script below.... This is literally copy/pasted from Scriptrunner's site.... so WHY isnt it resolving in either the console, or a custom job? Link: https://scriptrunner.adaptavist.com/latest/jira/custom-script-jobs.html
import com.atlassian.jira.component.ComponentAccessor
def issueService = ComponentAccesssor.issueService
def projectManager = ComponentAccessor.projectManager
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.with {
projectID = projectManager.getProjectObjByKey("MPLX-AWAN").id
summary = "Update Virus Definitions"
issueTypeId = "10001"
reporterId = user.name
}
def validationResult = issueService.validateCreate(user, issueinputParameters)
assert !validationResult.errorCollection.hasAnyErrors()
def issueResult = issueService.create(user, validationResult)
log.info "Issue created: ${issueResult.issue}"
Error is : Failed type checking: Not all types of code can be checked. It's yelling about the first line.
Check for typos and correct case (groovy is case sensitive.
I found 3 errors:
def issueService = ComponentAccesssor.issueService
This compiles for me
import com.atlassian.jira.component.ComponentAccessor
def issueService = ComponentAccessor.issueService
def projectManager = ComponentAccessor.projectManager
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.with {
projectId = projectManager.getProjectObjByKey("MPLX-AWAN").id
summary = "Update Virus Definitions"
issueTypeId = "10001"
reporterId = user.name
}
def validationResult = issueService.validateCreate(user, issueInputParameters)
assert !validationResult.errorCollection.hasAnyErrors()
def issueResult = issueService.create(user, validationResult)
log.info "Issue created: ${issueResult.issue}"
Hey there Zachary,
I'm the lead tech writer at Adaptavist and I just wanted to let you know that we saw your post and our tech writer has edited our documentation to make copy/pasting that script easier. You can find that documentation here: https://docs.adaptavist.com/sr4js/latest/features/jobs/custom-jobs. Hope that helps (or helps someone else in the future.) Thanks for bringing this to our attention!
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.