Hello all!
I'm using script runner to send out custom emails in post functions.
I store this script on the server file system under jira.home.
When I create this post function, there is no problem to choose the file from the file system and the post function works as desired.
Hoooowever, when I want to edit the post function, there is no reference to the file or where it's located on the file system.
Here is a screenshot when I try to edit the post function.
It makes no difference whether I choose SCRIPT or FILE I always get the Inline script.
Hopefully someone has figured this out!
P.S, The Jira version is 8.2.5
Hi Sigursteinn
The SCRIPT tab is used only when you want to keep your script in-line and store it in the workflow (it's embedded in the workflow and can be exported with the xml)
The FILE tab is used to tell the workflow which file on your filesystem contains the script. The workflow definition only contains the file path.
The two are mutually exclusive. Your script can exist in one place or the other.
When using FILE, once you've added the script to the file system, you may edit the script directly in the file system. A typical approach is that you update the script on your local machine and have a CI/CD tool to deploy and refresh the file. I simply use winscp for my dev/test environment.
In recent versions of Scriptrunner, the Script Editor tool was added. You can find it from the add-ons administration page. There, you can find and edit your file directly from the Jira application.
Changes to files are effective immediately, there is no need to re-publish the workflow.
@Peter-Dave Sheehan thank you for the answer :)
I realize what the two tabs are doing, what I was trying to point out is that there is no way of seeing what file is being referenced when the workflow is edited.
In the screenshot, I am trying to edit the post function to see what the filename is, but I cannot choose between FILE or SCRIPT. When I click on ether one the only that remains on the screen is the Inline Script window.
It seems I have to document it very well where each script is for each workflow, not that there is anything wrong with that.
I just needed a way for the Jira admins to be able to quickly tell what script needs to edited.
Thank you :).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I misunderstood the question.
I've seen this occasionally after upgrading scriptrunner.
When I go to an older workflow, it doesn't realize that the configuration points to a file and it displays the script tab.
Also, when you have a NOTE in yoru configuration, the PATH of the file is hidden. I wish it still appeared. But if you leave the NOTE empty, then it will show you right in the post function tab where the file is:
Empty:
With note:
So, my experience is that when I go back to edit that post function, I see this:
If you see a blank in-line script editor and you know there is a file, but it won't let you change the tab, enter some text in the script editor then clear it out. It should let you switch back to FILE tab and still show you the file path you selected previously.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Peter-Dave Sheehan That does it :), I've tested it on my and and I get the same results.
I will report to my fellow co-workers and let them know to leave it empty in Jira. All the information needed will be in the groovy file.
Thanks a lot for this!
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.