Create issue gives privilege error even though the given user has the needed privileges

Hi.

I have a script that creates tickets in a project called "Time Log Accounts".
The script is called when an Epic is transitioned from the state "To Do" to "In Progress".
The script creates tickets by calling this method:
IssueService.CreateValidationResult createValidationResult = issueManager.validateCreate(user, issueInputParameters)
if (createValidationResult.errorCollection.hasAnyErrors() || createValidationResult.warningCollection.hasAnyWarnings() || !createValidationResult.isValid()) {
log.warn("\nShould not happen! CreateEpicAccounts createValidationResult Errors " + createValidationResult.errorCollection +
"\nWarnings " + createValidationResult.warningCollection.warnings + "\n User " + user)

The user in the script is a user I have called "ProgramUser". This user is only used from scripts and have administrator rights in the "Time Log Accounts" project.

When JIRA users tries to transition an Epic from "To Do" to "In Progress" I get an error in the jira server log:

Should not happen! CreateEpicAccounts createValidationResult Errors Errors: {pid=You do not have permission to create issues in this project.}
Error Messages: []
Warnings []
User ProgramUser(programuser)

If I log into JIRA with the user "ProgramUser" I am able to do this transition and the tickets are created.

So my question is why am I allowed to do this manually and not through the API? It clearly states in the API that the user given as the parameter to issueManager.validateCreate() is the user in which the privilege check will be run against

1 answer

1 accepted

0 votes
Accepted answer

This is due to a bug in JIRA (https://jira.atlassian.com/browse/JRASERVER-22111)

 

It does infact use the logged in user instead of the one given to the API call.

Luckily it's a workaround that can be used to get around this, but the issue should be solved in JIRA as this could cause a security issue.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,356 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you