Hello,
I have an Elements Connect custom field containing a user name. On transition, I need to set the assignee to the value found in this field. I'm trying to use a post function and tried many solutions found here but none worked unfortunatelly.
I found this
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 pluginAccessor = ComponentAccessor.getPluginAccessor();
def plugin = pluginAccessor.getPlugin("com.valiantys.jira.plugins.SQLFeed");
def serviceClass = plugin.getClassLoader().loadClass("com.valiantys.nfeed.api.IFieldDisplayService");
def fieldDisplayService = ComponentAccessor.getOSGiComponentInstanceOfType(serviceClass);
def customFieldId = "customfield_10613";
String displayValue = "";
Object displayResult = fieldDisplayService.getDisplayResult(issue.get("issuekey"), customFieldId);
if (displayResult != null) {
displayValue = displayResult.getDisplay();
}
issue.setAssignee(ComponentAccessor.userManager.getUserByName(displayValue))
issue.store()
//return displayValue;
But the displayValue prints what it should
Your script ran successfully against issue ISSUE-258
String
Donald Duck
But when I remove the return display and try to set this value as assignee I get
Your script ran successfully against issue ISSUE-258
null
Could you please tell me what I'm doing wrong? I'm quite new to Jira :-/
Hello Dimitra Metanitis,
I'm part of the Elements Support team.
Is your connect field a Live Text field or a Live User field?
Can you tell me what post-function you are currently using?
In addition, can you please tell me which version of Elements Connect you are using?
Kind regards,
Simon.
Hello Simon,
It is a Live Text field. The post function is
Version is 6.3
Thanks for your help!
Dimitra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for this information.
to go further, I would need to know your Connect field configuration.
I invite you to create a ticket on our Support platform by clicking on the following link: Support Elements
We will then continue to deal with your problem where we left off.
Kind regards,
Simon.
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.