The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi community,
I am trying to use a ScriptRunner post-function to clone a SD Request into a new SD Request. In the newly created request, approvers are not automatically added, and therefore I would like to define them in the ScriptRunner cloning post-function.
Here is my code:
def cfChange = customFieldManager.getCustomFieldObjectByName("Approvers")
def userManager = ComponentAccessor.getUserManager()
def user = userManager.getUserObject("USERNAME")
issue.setCustomFieldValue(cfChange, user)
But I get this exception:
java.lang.NullPointerException: Cannot get property 'id' on null object
test
What's the correct way to add a group of approvers in the "Approvers" JSD custom field?
I found this in the official documentation, but it's not helping me much:
Thanks in advance for your help.
Cheers,
David
I finally found the solution... The Approver field used by the customer was a new translated field. It worked much better using the following:
def cfChange = customFieldManager.getCustomFieldObjectByName("Approbateurs")
This month the spotlight is on AppLiger. We caught up with Pavel Pavlovsky, CEO and Product Manager, to learn how the company started and what fuels the team's creativity. Atlassian:...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.