Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Append XSRF token to a Script Fragment Link? Edited

Our dev team is tired of copying data from a parent item to a sub-task every time they create one. I have introduced a new transiton that creates the subtask and copies a set of data elements in the process. This works well but, of course, the transiton button appears in the available transition list. The team would like this transition to appear in the More actions dropdown - specifically, it should replace the normal Create sub-task option in the operations-subtask area.

I have added a scriptrunner fragment that removes the native create sub-task option and a second one to introduce the new option. This custom web item fragment has a "Do What" option of "Navigate to Link". The Link is set to 

/secure/WorkflowUIDispatcher.jspa?id=${issue.id}&action=901

where 901 is the new transition that I'd like run. 

This all works well with the exception of a missing XSRF security token error. If i append &atl_token=mysecuritytoken into the link, the operation works perfectly. 

Is there any option to append the user's token in the above link string?  

2 answers

1 accepted

0 votes
Answer accepted

The support desk at Adaptavist give me this link to the Form Token Handling article on Atlassian's site.

Appending &atl_token=${atl_token} to my above link worked perfectly and was exactly what i was looking for. 

One caveat if you are calling transitions this way is that any screens you may have will not appear in a modal but rather full screen. A minor difference that isnt a deal breaker for me. 

XSRF token is typically in cookies as part of http requests - haven't had a need to generate one myself with Java API yet but this looks promising https://docs.atlassian.com/software/jira/docs/api/8.5.8/com/atlassian/jira/security/xsrf/SimpleXsrfTokenGenerator.html

What comes to mind is..

 - either generate a new token and use it (if it will be valid and work)

 - get the user's xsrf token from the HttpRequest when they open the issue view

 - disable the xsrf token check altogether (via a header passed in the http request)

Suggest an answer

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

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

243 views 7 7
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