Hello,
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.
BR
Xavi
Hello,
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.
Regards,
Elifcan
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.
BR
Xavi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Elifcan,
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.
issueInputParameters
.setProjectId(targetProject.getId())
.setSummary(issue.getSummary())
.setDescription(issue.getDescription())
.setIssueTypeId(issueType.getId())
.setPriorityId(issue.priorityId)
.setReporterId(issue.reporterId)
.setSkipScreenCheck(true)
IssueService.CreateValidationResult createValidationResult =issueService.validateCreate(user, issueInputParameters)
if(!createValidationResult.isValid()){
log.error(createValidationResult.getErrorCollection())
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This script seems like missing some important parts. Did you copy the whole script? Because there should be an else like this:
else {
issueService.create(user, createValidationResult)
}
Also which user do you use as "user", the logged in user or a static single user or anybody else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, I didn't copy the whole script. I used the below script
if(!createValidationResult.isValid()){
log.error(createValidationResult.getErrorCollection())
}
else{
IssueService.IssueResult createResult = issueService.create(user,createValidationResult)
if(!createResult.isValid()){
log.error("Error while creating the issue.")
}
}
and user is used as the logged in user.
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found a bug report which seems related to your issue? Can you check this out?
https://jira.atlassian.com/browse/JRASERVER-42609
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.