Hi,
According to some topics here, I created workflow. When an issue is created, assignee is automatically the creator.
The issue is, that it also does this thing when I assign the assignee by myself. However, I want to set it automatically only in case I leave it blank.
Is there a way how to make this work?
Hi @Mario Bumbera ,
1. If I'm right you might have added post-function in your workflow to assign the ticket to creator which will basically ignore the assignee field value if there is any and will assign to creator based on the function you configured
2. if you set default assignee to project lead/component lead(in project settings not in workflow post function) will assign only if the assignee is empty
3. You can go with scriptrunner's post-function and ask your script to assign to current user if assignee is empty, below may snippet may help you(NOTE: this one I wrote for server not sure about cloud)
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.util.UserManager
def issueManager = ComponentAccessor.getIssueManager()
def issueService = ComponentAccessor.getIssueService()
def userManager = ComponentAccessor.getUserManager()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
if(!issue.assignee){
issue.setAssignee((currentUser))
}
BR,
Leo
Thank you for your answer.
I tried the solution you described in poitn no. 2, but it does not do what I need. It automatically set the assignee to Project Lead which is one specific person.
I want the following:
1. Create an issue and set the assignee to creator if assignee is empty
2. If the assignee is filled set it to entered perosn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you configured the 2nd point through workflow post-function? if so you should remove that function and go to users role--> Edit default--> Default assignee to Project lead
this will assign the unassigned ticket to project lead if you provide assignee details during creation it wont' assign to project lead
To achieve your requirement you may need to go with other add-ons like scriptrunner and so on... which will check your condition if assignee is empty will assign to current user that's what my above script is doing..
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.