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

Script Tool for executing External API Calls

Ralf Dahmen August 12, 2020

Hello Community,

 

i'm searching for a function or app to do some kind of scripting/api calls based on jira event triggers.

For example, whenever a new customer ist created by creating a new issue from mail, we want to do a REST API Call to 

1. Check for Customer in our Invoicing System

2. If not existent, create the customer in our Invoicing System

Does anybody know some smooth built-in function or is using some kinda app for this use case?

Free app would be prefered.

Thanks

2 answers

1 vote
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2020

Hi Ralf,

I'd be inclined to try and solve this using Automation for Jira, which is an Atlassian-owned app that runs on your local Server instance. You can play around with the rules and see what actions are available even before installing by heading over to the rule playground .

Depending on your invoice system's API, this could be as simple as one API call. Here's a potential example of firing a webhook when an issue is created:

image.png

Smart values in Automation for Jira allow you to access information from the triggering issue - like the reporter's name or email address. There are also smart values for webhook responses, so you could chain actions together based on what the responses from your inventory system's API look like.

These rules execute and process on your local Jira server, so that should alleviate concerns about involving a third-party or external system.

Cheers,
Daniel | Atlassian Team

Ralf Dahmen September 4, 2020

Hey @Daniel Eads,

thanks for your reply.

Actually i've been playing around with Automation a little bit.

Quite cool stuff, but I haven't found an oportunity to use it with dependencies as described above.

Is It possible to build some kind of

Do Response1 = WebRequest1

if Response1 == HTTP 200 

then WebRequest2

else WebRequest3

 

 Regards

Ralf

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2020

Certainly! Tick the "Delay execution of subsequent rule actions" checkbox in the Send Web Request action. This will give you some help text about how to access the response from the webhook:

HOW DO I ACCESS WEBHOOK RESPONSE VALUES IN SUBSEQUENT RULE ACTIONS?

On successful webhook execution, you would be able access webhook response data using the following smart values:

  • {{webhookResponse.status}} returns the response code e.g. 200
  • {{webhookResponse.headers}} returns the response headers that you can access using dot notation e.g. {{webhookResponse.headers.Content-Type}}
  • {{webhookResponse.body}} returns the response body, if the body is a JSON object then you can access values using dot notation e.g. {{webhookResponse.body.name}}
  • {{webhookResponses}} returns a list of responses e.g. {{webhookResponses.last.body}}

Then you can add an if / else block condition to compare the webhook responses to the values you want, and take further actions inside the blocks. The additional actions in the blocks can be more "Send web request" actions!

1 vote
Trevan Householder_Isos-Tech-Consulting_
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.
August 12, 2020

@Ralf Dahmen I'm not sure what your invoicing system is but you might check https://zapier.com/ to see if they have an integration built for it.

Ralf Dahmen August 12, 2020

Hey @Trevan Householder_Isos-Tech-Consulting_

thanks for your reply.

due to Out Data Security Policies, we are forced onPremise Services Only.

so Full Featured Cloud Integration are no Opportunity for us

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events