I'm using script runner in post function to create new issue and link it with current working issue. It's strange that I didn't set the assignee in the workflow(new issue creating) but I still get the error "You don't have permission to assign issues". Could you please help with this strange case? Thanks.
Could it be because there is a screen on create transition of the new issue you are trying to create? There may be required fields on these screen like assignee.
Or there may be a post function that sets the assignee on this create transition. I suggest you check the workflow of the new issue you are trying to create.
Thanks Elif. Yes, I've checked the workflow of the new created issue, but the assignee field is not required on the create screen. And for the workflow, I didn't add any post function to set the assignee...Now the workaround is to grant "reporter" the "assignee issue" permission but this caused some reporters assign the issue to himself during the workflow. Could you please suggest? Thanks again.
Is there a default assignee on the project itself? You can check it on project's settings > Users and Roles.
Could there be default assignees based on components? You can check it on project's settings > Components.
Could there be a property on the workflow statuses such as jira.permissions.assign.denied ?
This error suggests that somehow there is a rule that when creating a new issue, assignee should be assigned.
Also how exactly are you trying to accomplish this? With a customized script or a built in feature of Script Runner plugin?
Thanks for your reply. I've checked all you mentioned in your answer, no default assignee, no component and no property was set in the workflow. I can create the issue on webUI. The error only occurred when using script runner(post function script) to create issue. The script is as below.
IssueService.CreateValidationResult createValidationResult =issueService.validateCreate(user, issueInputParameters)
This script seems like missing some important parts. Did you copy the whole script? Because there should be an else like this:
Also which user do you use as "user", the logged in user or a static single user or anybody else?
No, I didn't copy the whole script. I used the below script
IssueService.IssueResult createResult = issueService.create(user,createValidationResult)
log.error("Error while creating the issue.")
and user is used as the logged in user.
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
I found a bug report which seems related to your issue? Can you check this out?
What Jira version are you using? This may be your problem.
Because I couldn't think of any other reason but a bug at this point.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event