How to get the cookie, on clicking any transition button

i want to get the cookie from the browser, when i click on the transition button on view issue page.

Actually i want to perfrom the cookie base authentication.

Once i'll get the cookie then i would be able to pass it to the rest api for cookie base authentication.

1 answer

0 vote

Hi Muhammad,

We have steps on how to generate the cookie from your login session over on JIRA REST API Example - Cookie-based Authentication.

But if I understand your request, you want to be able to obtain the cookie via your browser session, say when a transition occurs.   This cookie is actually getting generated when you login it Jira, and not necessarily when this transition happens. 

But you might be able to use something like the developer Tools in the Chrome browser to obtain the JSESSIONID in order to do this.   I took a look at my browser to see what this looks like in the developer tools after an issue transition:

browsercookie1.png

But you can notice here that on that line of the JSESSIONID, the expiration is set to 'Session' rather than a specific date.   These cookies always have some value for when they expire, but with a session timeout set, as soon as this session is over that cookie would expire.  It isn't clear to me if you could actually use that cookie for a REST API authentication as such.  Instead I would still recommend following the steps in JIRA REST API Example - Cookie-based Authentication if you want to use cookie based authentication.

Regards,

Andy

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,316 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot