Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Script Runner || JMWE || not working

SankaraRao_Kalagadandu December 14, 2020

Dear Experts,

I am trying to create a post function using script runner(JMWE) using below script to prefix a custom field value to Summary.

issue.get("customfield_XXX") + " " + issue.get("Summary")

Above script is working fine when testing in post function groovy script console, but not working after publish. I added the post function after create event.

 

 

1 answer

1 accepted

0 votes
Answer accepted
SankaraRao_Kalagadandu December 14, 2020

SR.gif

David Fischer
Community Champion
December 15, 2020

@SankaraRao_Kalagadandu ,

you need to use a Set Field Value post-function, not a Scripted (Groovy) post-function. And place it at the top of the list.

In the Set Field Value post-function, select "Groovy Expression" as the value type, and use your script as the value.

SankaraRao_Kalagadandu December 15, 2020

Thanks @David Fischer , Actually I used a set Field post function but the result is displaying as code.

Error_RT.gif

David Fischer
Community Champion
December 15, 2020

You need to select "Groovy Expression" as the value type, not "Constant or Groovy Template"

SankaraRao_Kalagadandu December 15, 2020

Thank you so much @David Fischer . I updated the code below and now it is working.

${issue.get("customfield_XXX")}: ${issue.get("summary")}

Suggest an answer

Log in or Sign up to answer