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

Script Tool for executing External API Calls

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

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

Hey @Trevan Householder

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

1 vote
Daniel Eads Atlassian Team Aug 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

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 Sep 04, 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!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

189 views 1 6
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