Integrating application with JIRA Cloud REST API

Hi Everyone,

I developed some small app that calls the JIRA Rest APIs to get the history of the tasks (or whatever, it is based on the JIRA Query specified in the input) and shows a chart with each task and the time spend on each status. And another line to show the average that we spend on each part of the flow. You can use any query, select/unselect status, select the items returned, click to open them in a new tab, etc.
My idea is to use this to show the team how much time we are losing in average if some task is in code review for example, or show the PO that we a Lead time of X as tasks are open 50 days before we take them, and other things.
Then I could have this deployed somewhere and anyone in the team or management could analyze in details our cycle time.

The application currently is deployed and works , but there are 2 main issues/questions that I have:

  1. What is the best way to authenticate the users? At the moment the user needs to be logged in in JIRA and the REST call will work using the browsers cookies. I don’t want to have any API token hardcoded here.
  2. At the moment the only way to make it working is using Chrome and disabling CORS (–disable-web-security), so it is not viable to have in production or to send the link to users as they need to open a special way. How can I avoid CORS issues in JIRA Cloud?

If anyone wants to point me to the directions I would be very happy :slight_smile:

Cheers!
Marcos

1 Like

Are you using the OAuth 3LO authentication mechanism and api.atlassian.com (which supports CORS)? https://developer.atlassian.com/cloud/jira/platform/oauth-2-authorization-code-grants-3lo-for-apps/

I think this may solve your problems.

1 Like

No, I didn’t try using 3LO yet.
Will try to implement it.
Thanks for pointing that out.

@rmassaioli thanks for pointing out in the right direction.
I tried to follow the steps in the page you posted and it worked (so far with hardcoded values in my local machine), now I just need to implement correctly :smiley:

1 Like