Hi,
I've been tackling this problem for a while now and feel like I'm stuck, so any help would be greatly appreciated.
I want to setup JIRA to apply custom logic (based on Components selected) when auto-assigning new tickets if the user selected more than one Component.
What I've tried so far:
1. Write a post function - seemed like a great idea until I found out that by the time I get access to the Issue object the Assignee is already set, and there is no way for me to determine whether Assignee was set explicitly or not.
2. Then I decided to cheat the system and write a Validator instead - but encountered the same problem - default auto-assignee funtionality is executed before the Validator has access to the issue.
I think the only other thing I can try at this point is a plugin that lets me run scripts (I've read a bit about JSS and ScriptRunner), but I have no idea where to start with those.
Can anyone point me in the right direction?
Ideal solution would be if the Assignee field would update dynamically as you change Components in the Create Issue screen.
Second best would be if it ran as you click the Create button (so I can check if Assignee was set explicitly before doing anything).
Thanks for your help!
Community moderators have prevented the ability to post new answers.
OK, found a solution here: https://answers.atlassian.com/questions/89722/determine-if-automatic-was-choosen-for-assignee-within-workflow-validator
Apparently you can access the HTTP request when executing a post function, including what was in the Assignee field when the Create button was pressed. Thus I came back to my Workflow Post Function plugin, added this check there and got exactly what I needed!
That's a good one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Isn't that already handled by JIRA?
So you need to handle only if the user didn't select any assignee. So in the post function, if the assignee is empty, you can do your logic to assign to whoever you need to.
Is that what you looking for or did I get your question wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This only works when a single Component is selected. If the user selects more than one Component, JIRA selects the one that is first alphabetically and sets that Component's lead as the assignee. That's the case that I need to handle.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So in that case dump the JIRA functionality of automatically assigning using Component leads. If you do that, then if the assignee has a value, it has to be what the user has selected. If not, do your logic in the script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wouldn't that mean that I would have to allow unassigned issues in Jira options? Which would in turn mean that that I would have to add validators for all edit actions to prevent people from manually removing the assignee? I don't think Jira even supports Validators on Edit action without overriding parts of the system.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes (i was assuming it was the case).
Edit is not an issue, just remove the assignee field from the edit screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you can have a development lead a project lead as well as a QA lead, this way when the work flow passes from development to test the user assigned to that component can be automatically assigned as well. any thoughts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.