Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Email Link to transition when issue is created

Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2012

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.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2012

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!)

Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2012

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>

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2012

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.

Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2012
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2012

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)

Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2012

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??

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2012

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.

Isaac Montes
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2012

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.

&lt;html&gt;
&lt;head&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt;
&lt;script&gt;

$.ajax({
	headers: {'X-Atlassian-Token':'no-check';},
  	type:'POST',
  	url:'http://localhost:2990/jira/secure/WorkflowUIDispatcher.jspa?id=10100&amp;action=11',
  	});
  
$(document).ready(function(){
  	$("p").click(
  	function(){
		window.open('http://localhost:2990/jira/secure/WorkflowUIDispatcher.jspa?id=10100&amp;action=11');
	}  
  );
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;	
&lt;p&gt;Click me away!&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

S May 6, 2014

hi Isaac,

Did this finally work out for you?

TAGS
AUG Leaders

Atlassian Community Events