How can I use OAuth between JIRA and AWS Lambda?

Alex Hamilton July 13, 2017

Hello,

I wish to use a lambda function in AWS to create issues in JIRA using the jira-python sdk. I want to authenticate with OAuth, but need some help getting going. 

Basically, I am unsure of what to put as my application url in JIRA's "Application Links"

Do I need to build a custom application in AWS?

Any help will be greatly appreciated, thanks!

3 answers

0 votes
Ankit
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 21, 2019

Hi Alex,

I work with miniOrange,an Atlassian marketplace vendor.

We provide a REST API authentication app for Jira which can authenticate the APIs using AWS as OAuth provider.

If you're using Jira's REST API's to create an issue in your Lambda function, then you can use this app to authenticate it using AWS's OAuth access token.

If you would like to explore this solution further, just drop us an email at atlassiansupport@xecurify.com, we would love to discuss your use case further.

 

Thanks,

Ankit

0 votes
venkatesh kanakamedala September 5, 2018

Hi Alex,

 

Do you have a sample python code to create issue in jira from AWS Lambda?

Can you please pass it to me here?

I am currently working on it and badly in need of the code.

Deleted user November 6, 2018

Hi Alex

Check out the Python Jira library - https://github.com/pycontribs/jira

You can include this in a Lambda deployment package.

Cheers,

Cameron

0 votes
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 27, 2017

You do not need to build a custom application in AWS for this to work, and as per Mibex Software's nice walk through on How to use OAuth with Atlassian products you can "just use any application URL"- their example is based on Bamboo, but applies to JIRA as well:

While Atlassian’s cloud solutions like Bitbucket Cloud make it very easy to use OAuth, the behind-the-firewall editions of Atlassian products like Bamboo Server make this significantly harder — yet not impossible. In this blog post, we will show you how you can access Bamboo’s REST API with OAuth1. To achieve this, we’ll make use of application links. Although we have chosen Bamboo here, the basic procedure is the same for JIRA, Confluence and Bitbucket Server.

[...]

ankita_pradhan August 15, 2019

Hi,

Can we auto generate the jira tickets on getting alams from aws cloudwatch , using http auth?

Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 16, 2019

Sure, you can either use the Jira REST API, possibly via a client library for your language of choice (see other answer), or given you are on AWS already, you could also reuse the existing AWS-CreateJiraIssue Systems Manager Automation document that does the heavy lifting for you.

First you have to store your credentials in the Systems Manager Parameter Store - the automation flow might then be:

  1. CloudWatch triggers alarm and sends notification to SNS topic
  2. Lambda function subscribed to that topic is executed and:
    • Either retrieves auth SSM parameter and creates issue via Jira REST API
    • Or executes AWS-CreateJiraIssue SSM automation document (which implicitly retrieves the auth SSM parameter too)
ankita_pradhan September 16, 2019

Hi Steffen,

Thanks for the reply. I have a query regarding this i.e. how do I link the cloudwatch alarm and the lambda function. For example: If I am getting alarms for cpu over utilisation (I am aware of the inbuilt ec2 monitoring) then how to trigger lambda on getting that alarm so that when the lambda function gets triggered a ticket is created in jira.

 

Thanks and Regards,

Ankita

Suggest an answer

Log in or Sign up to answer