Hi!
I am using Script Runner post function in order to clone issue from JSD project til business project (Clones an issue, and links).
I have custom field in the target project having the type Elements Connect (nFeed) custom field.
I want to set value 'CUSTOMERQUERY' to the created issue.
I am trying the script
def pluginAccessor = ComponentAccessor.getPluginAccessor();
def plugin = pluginAccessor.getPlugin("com.valiantys.jira.plugins.SQLFeed");
def serviceClass = plugin.getClassLoader().loadClass("com.valiantys.nfeed.api.IFieldValueService");
def fieldValueService = ComponentAccessor.getOSGiComponentInstanceOfType(serviceClass);
def issueKey= issue.getId().toString()
def customFieldId = "customfield_17005";
def nFeedKeyValue = "CUSTOMERQUERY";
fieldValueService.setFieldValue(issueKey, customFieldId, nFeedKeyValue);
but I get error ' Cannot finding the matching method'
can any one help me to write the script?
Hi @Juhaina Almama ,
I'm on the Elements Support Team.
Even if an error appears in the console, your script is still supposed to work. I have just tested it and it works for me.
You just have to make sure you entered a valid key and nothing else:
Concerning the error message, I am afraid we can't do anything for you to fix that. Indeed, the syntax validation feature doesn't check external classes that are added within the script, because it's loaded on runtime.
In addition, you will find on the following link our documentation showing some examples of the use of Elements Connect fields in Scriptrunner: https://doc.elements-apps.com/elements-connect/latest/api-guide/java-api/scriptrunner-use-elements-connect-api-in-a-script
Have a nice day.
Kind regards,
Simon.
Thank you Simon, it was nFeedkeyvalue problem since I used value and not the key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My pleasure. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Simon Laffont ,
How do I get the other values from the query results using ScriptRunner post function? I've only been able to get the key and the display value.
Thanks,
Nkem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Juhaina Almama,
I'm on the Elements Support Team.
Even if an error appears in the console, your script is still supposed to work. I have just tested it and it works for me.*
You just need to make sure you entered a valid key and nothing else:
Concerning the error message, I'm afraid we can't do anything for you to fix that. Indeed, that's more a ticket for Adaptavist, the editor of ScriptRunner. Their syntax validation feature doesn't check external classes that are added within the script, because it's loaded on runtime. Thank you for your understanding.
In addition, here is documentation showing some examples of the use of Elements Connect fields in Scriptrunner: https://doc.elements-apps.com/elements-connect/latest/api-guide/java-api/scriptrunner-use-elements-connect-api-in-a-script
Have a nice day.
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.
You can use the Elements Connect API in scriptrunner. Documented here: https://doc.elements-apps.com/elements-connect/latest/api-guide/java-api/scriptrunner-use-elements-connect-api-in-a-script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your replay , this exactly what I did, but it is not work , can you help? ,I am new i writing script :(
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.
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.