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

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

JIRA Cloud: Execute script on remote server

Hello,

We are looking at adding a post function to a workflow transition that will execute a script (shell or ?) on a remote server when the transition is changed to "Approved".  Something like:

ssh userdude@192.168.10.10 ./myscript.sh

Looking at "Power Scripts for JIRA", but I couldn't find any doc on how to do something like this.  Has anyone else been able to do this and if so, what tool/plug-in did you use, etc. to make it work? 

1 answer

Hi Dave, there are quite a few ways to do something like this with Power Scripts.

Triggering the script on the remote system:

  1. Set up a Remote System link. Once that is established you can simply use the call() routine to execute the script on the other system. The first parameter of the call() routine is which system the script should run on.
  2. Or, use the Common REST Service to trigger a script on the remote system. The httpPost() routine can be used to send a POST request to the remote system in order to trigger the script.
  3. Or, use a custom SIL Webhook  to create a custom REST enpoint. You would still use the httpPost() routine to send the request to the custom endpoint.

Which option you choose depends on the amount of data you need to send to remote system. The custom webhook will allow you to send JSON data that offers the most versatility when it comes to passing data to the remote system. However, if you don't have much data to pass then the call() routine would be the simplest to implement.

Once the script is triggered on the remote system then the system() routine is used to run the shell script. The nice part about this routine is that you can also receive a response from the shell script. With all 3 examples above a response can be received to indicate success or failure from the script on the remote system.

Hope this helps.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

249 views 2 5
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