Hi,
So I made a groovy script to compare and fix the fixVersions field in subtasks based on the content of the parent issue. My big question now is: how do I store this issue back into Jira? I am using Jira 6.0.8.
Any and all help is highly appreciated.
Kind regards,
Jeroen Baten
The prefered way of changing an issue is descibed on the page Performing Issue Operations. If you use this way you don't have to worry about business logic (permissions) and indexing. You don't have to modify an issue object, it's all done by definining the new value within the IssueInputParameters.
A simpler way is to use the IsssueManager and its updateIssue() method after you modified the issue object. This method should take care of the indexing also, but doesn't check for appropiate permissions.
If you try to change an issue within a scripted postfunction or a listener there are some other things you have to take care of, but your questions doesn't suggest anything like that.
If I use IssueService.IssueResult issueResult = issueService.getIssue(currentUserObj,Issue) he complains about me not having enough rights. If I use as currentUserObj the value "null" he does too. What am I doing wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is currentUserObj a valid user? And what's "Issue"? It has to be an issue key (String) or an issue ID (long). Try to log both variables and their classes before calling the method.
log.setLevel(org.apache.log4j.Level.DEBUG) log.debug "$currentUserObj (${currentUserObj?.class.name})" log.debug "$Issue (${Issue?.class.name})"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I use IssueService.IssueResult issueResult = issueService.getIssue(currentUserObj,Issue) he complains about me not having enough rights. If I use as currentUserObj the value "null" he does too. What am I doing wrong?
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.