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
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 :).
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:
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.
Hello everyone, I am a product manager in the Jira Cloud team focused on making sure our customers have a delightful experience using our products. Towards that goal, one of the areas which is extr...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events