Hi,
I'm starting to use ScriptRunner's custom mail post function. It works nicely - but I have a question on the lastComment.
When I create the comment in Jira (in a transition), I can restrict visibility, like "Only administrators". But when I put together the mail, all I have is the lastComment variable (which is, as far as I can see, only a string) - and I don't want to send the admin-only restricted-visibility comment to the mail recipients.
What have I missed?
That "lastComment" variable is there as a simple convenience. I don't think it's intended for such edge cases.
Generally, the intent is to just include the comment that was just entered as part of the transition.
One variable I see that's not in the documentation is "comments" which should be a list of all comments. You could use this and find the last non-secure comment. Or review the permission of the last comment and only include it if groupLevel and roleLevel are both empty (or whatever they are defaulted to when you don't select anything in the comment security).
The lastComment is sort of what I need (the comment included in the current transition) - but the problem is that it's just a string, not an object - and thus with no role or anything useful, so I can decide whether to send it to the mail audience or not.
However, the undocumented comments does contain comment objects, so if I check the last one, I will probably be able to deduce if it was made in the current transition.
Thanks a lot for pointing out the comments var!
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.