Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

File name not showing in post function

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. 


image.png

Hopefully someone has figured this out!

P.S, The Jira version is 8.2.5

1 answer

1 accepted

1 vote
Answer accepted

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 :).

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:
2020-08-05 10_13_31-Transition_ Create Post-Release Filter - JIRA QSM Dev - https___projects-qsmdev..png

With note:
2020-08-05 10_12_58-Transition_ Create Post-Release Filter - JIRA QSM Dev - https___projects-qsmdev..png

So, my experience is that when I go back to edit that post function, I see this:

2020-08-05 10_15_31-Update Workflow Function Parameters - https___projects-qsmdev.qad.com_secure_adm.png
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.

@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!


Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Jira Cloud Performance Improvements

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...

184 views 2 9
Read article

Community Events

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

Events near you