I am trying to make some changes on my JIRA project where I have a Customfield (Single select or Free Text Type) and Assignee (system Field). When I create a Bug or Changes Assignee in any Transition, I would be using my Customfield to add the username and I want that username to be auto populate into Assignee field. But, if the username listed in Customfield does not exist as an active user in JIRA project, set the Assignee to Automatic or Unassigned. Where as if the username listed in Customfield exist as an active JIRA project user, copy that username from Custom field to the Assignee field.
How do I do this?
I tried to do this in Post function via "Copy value" function. It works only when the username listed in Customfield is an active jira project user. If the user listed in Customfield is no active jira project user, I get error message "Error creating issue: Unable to copy value from field '<customfield> to 'Assignee''".
The issue here is not about wheather I am able to assign the bug or not. The issue is that, if my user "xyz" is not an active jira user, the post function rule cannot copy the value from my customfield to the Assignee field and not able to create the bug. Hence, is theer a way to over come this issue? Or can thisbe done from Behavior plug in?
1) Customfield = abc, Auto populate abc to Assignee field. Here, the user abc exist in JIRA project as a active user.
2) Customfield = xyz, Auto populate "Unassigneed" to Assignee field. Here, the user xyz does not exit in JIRA project as an active user.
>The issue here is not about wheather I am able to assign the bug or not
It absolutely is about this. Your function is failing because the user is not a valid assignee.
It's not an issue, it's not something you can break with a Behaviour or botch. The person you are trying to name as the assignee must be an assignable user.
Basically assignee field can have only a jira active user. Here, you are trying to set the assignee field with a wrong value and thats why the error is.
It is as same as if you go to UI and type a user in assignee field, you will get a list of active users only. You can't put a wrong value there and update the assignee field.
Solution : You can write a postfunction where there will be a check that the value in customer field is a valid user then copy value.
Else populate assigne with unassigned.
You can check Atlassian documents on getting an idea of postfunctions
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot