I have applied one script in workflow post function, the use of script is to give me the latest comment.
I'm doling a transition from A status to B status, during this time I'm setting a default comment with post function custom script.
on the same transition I have comment screen as well:
Here my question is:
I am doing this transition A->B, if I'm not adding comment manually and directly doing the transition then the default comment is coming correctly.(Which is added in post function)
but what if I added a comment any message in the Response to customer section
it should give me "my manually added message/comment" + "default/static comment message"
here I'm getting my previous last comment(which was exactly added before performing the transition), but it is not giving me the last comment which I have added on the transition screen + Default/static message ? Why?
In very short- I need manually added message/comment + default/static comment??
Anyone's help regarding this matter would be really appreciated.
I don't use Scriptrunner but I use JMWE and I guess this may work for you too. Correct me please if I misunderstood your question.
If you want to add two comments into one, you can transform a transition comment by adding this script above the system post function "Add a comment to an issue if one is entered during a transition":
//Get a transition comment
def originalTransientVarsComment = transientVars.comment ?: ""
//Define the default comment
def defaultComment = "This is a default comment."
//Check if a comment has been added on the transition screen, then update it
if (transientVars.comment) {
transientVars.comment = originalTransientVarsComment + "\n\n" + defaultComment
} else {
transientVars.comment = defaultComment
}
Here's the example. I added a comment during the transition and this is what was added to my ticket:
Hi @Kseniia Trushnikova ,
Thanks for sharing the details, I'll check and update you regarding this.
Thank you for your support!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Durgesh Masurkar, did it work?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.