Navigation Menu

Skip to content

Commit

Permalink
[FIXED JENKINS-13998] Fix NPE when Jenkins user does not have access …
Browse files Browse the repository at this point in the history
…to perform any workflow actions.
  • Loading branch information
Joe Hansche committed Jun 1, 2012
1 parent e2f6768 commit 05a4e5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/main/java/hudson/plugins/jira/JiraSession.java
Expand Up @@ -290,10 +290,12 @@ public String progressWorkflowAction(String issueKey, String workflowActionName,
public String getActionIdForIssue(String issueKey, String workflowAction) throws RemoteException {
RemoteNamedObject[] actions = service.getAvailableActions(token, issueKey);

for (RemoteNamedObject action : actions) {
if (action.getName().equalsIgnoreCase(workflowAction)) {
return action.getId();
}
if (actions != null) {
for (RemoteNamedObject action : actions) {
if (workflowAction.equalsIgnoreCase(action.getName())) {
return action.getId();
}
}
}

return null;
Expand Down
Expand Up @@ -2,4 +2,6 @@
The workflow action to be performed on the selected JIRA issues.
<p />
Be mindful of the issues being selected by the JQL query, because not all actions are valid for all issue statuses.
<p />
<b>NOTE:</b> the Jenkins user must have access to perform the workflow step, as if the user were logged in and viewing the issue in a web browser.
</div>
2 changes: 1 addition & 1 deletion src/main/resources/hudson/plugins/jira/Messages.properties
Expand Up @@ -16,5 +16,5 @@ JiraIssueUpdateBuilder.NoJqlSearch=Please set the JQL used to select the issues
JiraIssueUpdateBuilder.NoWorkflowAction=A workflow action is required.
JiraIssueUpdateBuilder.UpdatingWithAction=[JIRA] Updating issues using workflow action {0}.
JiraIssueUpdateBuilder.Failed=[JIRA] An error occurred while progressing issues:
JiraIssueUpdateBuilder.UnknownWorkflowAction=[JIRA] Unable to update issue {0}: invalid workflow action "{1}".
JiraIssueUpdateBuilder.UnknownWorkflowAction=[JIRA] Unable to update issue {0}: invalid workflow action "{1}". Perhaps the Jenkins user does not have permission to perform the action on the JIRA issue?
JiraIssueUpdateBuilder.SomeIssuesFailed=[JIRA] At least one issue failed to update. See log above for more details.

0 comments on commit 05a4e5c

Please sign in to comment.