How to get comments in screen for postfunction via Groovy Script Runner?
transientVars.comment as String
Have fun,
Henning
Hey Henning
Not worked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead of last comment, I want to send comment at screen in email using https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Send+a+custom+email
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got error!
groovy.lang.MissingPropertyException: No such property: transientVars for class: groovy.tmp.templates.GStringTemplateScript55
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah ok, i thought you would like to access the comment from the transition screen from a scripted post function.
Did you surround my code with ${} within the email template? Maybe it helps if you post what you already tried.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm only guessing.. and if you try
<% out << transientVars.comment %>
?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, but not work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried it by myself. If I write this
Last Comment: <% out << transientVars.comment %>
as "Email template" it works. If no comment was provided during transition you get
Last Comment: null
as email, so you should test for null before you insert the comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does not work . Here is my configuration
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That may be the problem. I only tried it as a real workflow postfunction because transientVars is only there for real transitions.
I can't see a configuration in your previous comment...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try in admin panel or in workflow?
I am trying in admin panel and receiving same error?!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! I will try in a postfunction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Henning!
How to check for null?
Any documentation link for transientVars functions would be great!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you look at the linked page you provided earlier, there is an example on how to check for null for the last comment (https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Sendacustomemail). In general it's
if (transientVars?.comment) {...}
I don't know about a documentation about the transientVars. It's a Map, and it contains different fields in different situations. You could take a look at the content if you print the content to the log.
log.error "transientVars: $transientVars"
Henning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does not work!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What? A little more information would be nice. What did you do? How could you see that it does not work? Did you get any errors?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used, but no message is received.
Last Comment:
<% if(transientVars?.comment)
out << transientVars.comment
%>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any errors in the log?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Uh oh, you should change that if you want to go on with scripting JIRA. Maybe your IT department could give you read only access.
Did it work without the if statement?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes! it work without if statement.
Can you test on your side?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not have access on log file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I'll test it. Give me a moment, please :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Works perfect. With or without comment.
Maybe your condition is not met? Do you publish the changed workflow?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many many thanks! It works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Not works".
Wow - way to make it really really hard for other people to help you. Well done Henning... you have more patience than me.
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.
I'm also gettting groovy.lang.MissingPropertyException: No such property: transientVars for class:
I'm using the post function Comment linked issues Function for this transition and trying to catch the comment from the transition screen.
It says issue, issueObject and log are available objects so transientVars isn't?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you definitely using ScriptRunner? Your previous question suggested you were using another plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My bad, it was indeed JIRA Misc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just adding a "thank you". This is exactly what I was trying to do this morning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.