Hello All,
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''".
Hi,
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.
Regards,
Sanjay
Hi Sanjay,
Exactly, my approach was the same but I am not there yet. I am new to groovy/jira so may be I am not able to put the correct script on the right place. Would you please help me to acomplish the solution?
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can check Atlassian documents on getting an idea of postfunctions
Eg:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you are assigning an issue to someone, it must be someone that is currently allowed to be the assignee.
Check the project permissions and amend them so that the target people can be assigned issues in that project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
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?
Requirements are:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>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.
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.