Renaming scripts

Roy Chapman December 16, 2014

I have just renamed the path of a groovy script.  I have dumped the workflow configs to check I have got all instances and notice this entry where I have renamed.  How can i update the scriptFileName?  Or don't I need to bother?

<arg name="FIELD_SCRIPT_FILE">/app/localstorage/jira_home/groovy-scripts/emm-ready-for-qa.groovy</arg>
<arg name="scriptFileName">/sbclocal/apps/jira_home/groovy-scripts/emm-ready-for-qa.groovy</arg>

1 answer

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 16, 2014

Hey Roy... did you check my answer to your other question? You are allowed to give feedback to answers wink

It really depends what version of Script Runner and JIRA you are using. It's always advisable to use relative paths for this reason, or script roots in version 3 of the plugin.

If you have just a few you can edit the workflows in the normal way, and update the paths.

Rina Nir (AC)
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
July 4, 2016

(on JIRA 7.1.2, ScriptRunner  4.3.4)

As also need to review paths in the exported workflow xml (and possibly ammend and reimport), but in the exported xml the post function parameters are 'encripted':

&lt;function type="class"&gt;
              &lt;arg name="FIELD_FUNCTION_ID"&gt;YCFgMTQzYWFmMGZmODgxYWJkNzE0NGE1NjA0MTIyZGJmMDIyZjhlMjZjNQ==&lt;/arg&gt;
              &lt;arg name="full.module.key"&gt;com.onresolve.jira.groovy.groovyrunnerrungroovy-function&lt;/arg&gt;
              &lt;arg name="FIELD_INLINE_SCRIPT"&gt;&lt;/arg&gt;
              &lt;arg name="canned-script"&gt;YCFgY29tLm9ucmVzb2x2ZS5zY3JpcHRydW5uZXIuY2FubmVkLmppcmEud29ya2Zsb3cucG9zdGZ1bmN0aW9ucy5DdXN0b21TY3JpcHRGdW5jdGlvbg==&lt;/arg&gt;
              &lt;arg name="class.name"&gt;com.onresolve.jira.groovy.GroovyFunctionPlugin&lt;/arg&gt;
              &lt;arg name="FIELD_SCRIPT_FILE"&gt;YCFgY29tL3JhZGJlZS9wb3N0ZnVuY3Rpb25zL0FwcHJvdmFsX2hvbGRfcG9zdGZ1bmN0aW9uLmdyb292eQ==&lt;/arg&gt;
            &lt;/function&gt;

Is there a way to cause the export to export/import the actual path name in 'FIELD_SCRIPT_FILE'?

 

(PS: the scripts are packaged as a plugin)

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 4, 2016

They are not encrypted but they are encoded - https://scriptrunner.adaptavist.com/4.3.3/jira/releases/current-release.html#_base64_encoding_for_workflow_function_arguments

You can decode them... it doesn't matter if the args are encoded or not in the workflow.

It's true that some of the args don't need to be encoded and it would be clearer if they were not: https://productsupport.adaptavist.com/browse/SRJIRA-1965

Rina Nir (AC)
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
July 4, 2016

Thanks, have voted for the issue, your input will help me workaround this obstacle.

Suggest an answer

Log in or Sign up to answer