hi there.
have a ScriptRunner v.4.3.4 and JIRA 7.1.0. the task is to create a scheduled issues, one per week via Services.
I tried the code below,
import com.atlassian.jira.component.ComponentAccessor
def issueService = ComponentAccessor.issueService
def projectManager = ComponentAccessor.projectManager
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def constantsManager = ComponentAccessor.getConstantsManager()
def issueType = constantsManager.getAllIssueTypeObjects().find {it.name.equalsIgnoreCase("Incident")}
def issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.with {
projectId = projectManager.getProjectObjByKey("SD").id
summary = "Scheduled Issue"
issueTypeId = issueType.getId()
reporterId = "admin"
}
def validationResult = issueService.validateCreate(user, issueInputParameters)
assert !validationResult.errorCollection.hasAnyErrors()
def issueResult = issueService.create(user, validationResult)
log.info "Issue created: ${issueResult.issue}"
return "Issue created: ${issueResult.issue}"but if paste it in Script Console, the result is
Issue created: null
can anyone explain me how to make it work?
Hello Keven,
I believe the best way you can do this is by adding AllWatchers permission in the browse permissions and in the comment permissions as well. Thus your issues will be visible not only for those who created them, but also for those you @mention in the issue, once they become watchers of an issue at the moment you mention them in it.
Hope this helps.
Regards,
Marlon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.