Can we run a script based on the issue transition using Jira automation without ScriptRunner Plugin?

Vish Mande
Contributor
March 31, 2023

Can we run a script based on the issue transition using Jira automation without ScriptRunner Plugin?

 

5 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Anne Saunders
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.
April 3, 2023

Hi, @Vish Mande - Can you tell us what you want the script to DO? (e.g., Are you trying to send an email? Make a Slack notification? Take an action in GitHub?) 

There's a wide variety of things you can do via Jira Automations, Including but not limited to the 3 I listed. 

2 votes
Peter DelSordo
Contributor
March 31, 2023

We are currently doing something like this using MuleSoft Anypoint Platform as part of an automated ERP Backoffice Integration solution we are implementing company-wide.  A trigger event can come from an outside application via MuleSoft, which will call native Jira Automation and transition an issue to a desired status.  This has been setup as one-way, during the Advanced Protoyping phase of our solution.  However, two-way software architecture is being utilized so our Jira Automation will work both-ways (i.e.-transitioning an issue to a certain status will sent REST API call to MuleSoft, which will in turn cause a script to execute sending another trigger event back to the desired application and show the status change.  (Note:  We do have ScriptRunner, and are actively using it as it does make the process easier to implement in the long run!)

2 votes
Sergei Gridnevskii
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.
March 31, 2023

Theoretically if you have a public hosting where you can run python or groovy scripts it is possible to expose a REST API and trigger it from Automation for Jira.

Vish Mande
Contributor
March 31, 2023

@Sergei Gridnevskii I like the alternate solution, Thanks for sharing.

0 votes
Karin van Driel
Contributor
March 31, 2023

Hi ,
Can you give a bit more information about what you are trying to do exactly? Is it a script for doing things inside Jira or Confluence, or something elsewhere? What kind of script? There may be a way to achieve your outcome without a 'trigger script' functionality that people here might be able to advise you on :)

Karin van Driel
Contributor
March 31, 2023

Sorry, tagged the wrong person, meant to tag @Vish Mande 

Vish Mande
Contributor
March 31, 2023

Hi @Karin van Driel  , @Aaron Geister 

Jira Automation is a pretty flexible and powerful feature when we are doing things inside Jira. But when we want to do things outside Jira and the trigger point is inside Jira then this feature has its limitation or dependence on a third-party tool like ScriptRunner. Bit disappointed that Jira automation itself won't provide this capability. Atlassian may have a reason for this. @Sergei Gridnevskii has mentioned another way around/alternate solution.

When we transition the issue from status A to B then trigger the automation framework in another application or perform certain actions in any target system/application. Here trigger point transition could be one of the scenarios, there could be multiple trigger point scenarios like updates on the ABC field, match value of the ABC field, etc. 

I appreciate your time and attention here :-)

Aaron Geister
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.
April 8, 2023

Firstly Automation for Jira was created by codebarrel and later acquired by Atlassian. So there is something it still omits to as it was a marketplace plugin and later integrated. There are some APIs that marketplace apps cannot hit for example group API for add and or remove users form groups. 

So I believe there is a webhook function trigger that can be used to reach outside of jira or cause things to happen within jira from the webhook trigger. 

I was also told that Scriptrunner can reach outside of the Jira world to other platforms. I have not tried it as I am using this for other actions internally. 

Another suggestion was Mulesoft which is owned by Salesforce. This is a great tool that we are using and starting to implement for ERP CRM integration and for Jira action to other systems and back.

Right now those are the thoughts I have to offer. I am sure you can make it happen. Another tool I do use is BetterCloud which can work with Jira and outside of Jira to most other systems but has some limitations. 

I wish you luck. 


Like Vish Mande likes this
Vish Mande
Contributor
April 10, 2023

@Aaron Geister - Thanks for the suggestion.

Like Aaron Geister likes this
Anne Saunders
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.
April 10, 2023

Assuming your external system allows webhooks, you can trigger one using an automation, but you can also do it from the workflow transition itself.

In the workflow, select to edit the transition you want to leverage and add a Post Function to "Trigger a Webhook," then put the webhook URL in the field provided on the next screen. 

If the target system doesn't allow webhooks (and depending on your other tooling and experience), you may be able to use a webhook as an intermediary to trigger your script, which can then act on your target external system. 

Like # people like this
0 votes
Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 31, 2023

@Vish Mande 

Jira does not support scripting natively so as a direct answer "no".

However as Jira Cloud does have automation, most of the time you can model the script you were going to run with the available actions/conditions in the automation rule.

Vish Mande
Contributor
March 31, 2023

@Dirk Ronsmans Thanks for the answer, Not sure if Altlassina has this feature in their roadmap, I don't find anything on the community as well about this requirement.

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 31, 2023

How do you mean? Automation is already a part of the system.

If you set a transition as your trigger you can easily model a lot of possible scenario's. It won't be a script but more like a low code/no code solution

Like Aaron Geister likes this
Sergei Gridnevskii
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.
March 31, 2023

I guess Atlassian has reasons for that. Nobody knows what you can put in scripts, like bitcoin mining, virus, something else. While graphic blocks are error prone and cannot crash Jira server.

Like # people like this
Vish Mande
Contributor
March 31, 2023

@Dirk Ronsmans I mean script feature with Jira automation. I was looking for a scripting native solution.

Aaron Geister
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.
March 31, 2023

I would like to know more of why you want to run a script in automation for Jira when it has low code no code solution and smart values to run pretty much anything you need. unless your trying to hit an end point to do something some where else which is still possible. 

Like Sergei Gridnevskii likes this
Sergei Gridnevskii
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.
March 31, 2023

Agree. I even managed to parse XML from external server with graphic blocks. It was hard but possible.

Like # people like this
TAGS
AUG Leaders

Atlassian Community Events