Im trying to create a .vm template to email a link that when clicked will perform the desired transition from the workflow. Copying the link address for the transitions won't work, because it depends on the issue.
Community moderators have prevented the ability to post new answers.
I'm sorry, I don't grasp what you're trying to do. The first part of your sentence is about a .vm template, then suddenly emailing something, then a transition. So...
What's the .vm actually for? A send form? The email content?
Is the email to be created by and sent from Jira? Or is it incoming email?
What is the relevance of the transition? You've already got transitions available, with outgoing emails, so I'm guessing you mean something else, but I can't work out what.
(I'm completely lost on the second sentence, because I think it's meaning depends on the first sentence!)
I created a new event from the createissue.vm
Everytime I create an issue I want to receive(or send) email to assignee with a link that when clicked transitions to the next step of the workflow I have this but is incorrect:
<a style="color:${textLinkColour};" href="${baseurl}/secure/WorkflowUIDispatcher.jspa?${issue.getID()}&action=4&atl_token=${atl_token}">Approve</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, ok, so you want to send an email from Jira to someone (assignee) that has some different content from the standard.
What you have seems close, but I don't think it's quite right after the ?. I think you've missed the id of the issue - you have the ${issue.getID} for it, but the url doesn't have id= in front of it. Try adding that and then tell us what comes out in the email if it's still not doing what you want.
Unfortunately, I'm not sure this will work at all - I don't know that the token is available in the velocity context (alhtough I think it is), but I'm pretty sure the tokenisation won't work for other users, as the token is probably from the users browser - I think you might simply get XSRF errors if your users click ont that email.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When JIRA sends the Email I want the template to render with a link that the url looks like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I think your comment before said that - I just think you're missing the "id=" bit in your .vm file (and I'm concerned that the atl_token might not be reusable in someone else's browser, but let's get the id= working first)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got the id part working, now I only need the token part so that I don't get XSRF errors I was using atl_token=${atl_token} but this does not seem to be working. Any ideas??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now, that's the think I suspect is going to really break it for you.
From my very limited knowledge, the token is something that the server has given to a user to say "I know who you are because you have logged in". When you generate an email, the token that is available is the one the user doing the transition has. That token is utterly useless to the recipient of an email because they won't have the token on their machine. Worse, if they try to use that token, it could, and should refuse them on the grounds that the token isn't theirs (it's one element of an XSRF attack which really should be blocked)
I really do not know if that is right, I am just guessing from a little bit of experience years ago.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got most of it now I need for JIRA not to check the token when I click the link, to do this I'm supposed to set the HTTP Header to 'X-Atlassian-Token':'no-check' but Im having trouble creating the template for that... this is what I have right now.
<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> $.ajax({ headers: {'X-Atlassian-Token':'no-check';}, type:'POST', url:'http://localhost:2990/jira/secure/WorkflowUIDispatcher.jspa?id=10100&action=11', }); $(document).ready(function(){ $("p").click( function(){ window.open('http://localhost:2990/jira/secure/WorkflowUIDispatcher.jspa?id=10100&action=11'); } ); }); </script> </head> <body> <p>Click me away!</p> </body> </html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.