COPY VALUE FROM FIELD TO FIELD POST FUNCTION

Hi there,

I want to copy a scripted field to a normal field during the post-function of the create step.

But it seems, that the scripted field is always null

2 answers

1 accepted

0 vote

You can't - the data for a scripted field only exists after the issue has been indexed, when it is too late to write new values to the issue.  So you get a null because there's nothing there yet. 

You need to forget the scripted field, and calculate what would go into it in your post-function to set the actual value.

Hi Nic/ Gabrielle, 

Thanks for the quick reply. I need to copy the value of the Scripted field on to the Summary.There is some value written in the Summary. So I need to overwrite it with the Scripted field value( Which depends on the data entered in the create screen). As soon as create screen is pressed I need the value in the scripted field to appear on the summary

It's the same answer - forget the scripted field, it's not there until too late.  Replicate the logic in your post function.

 

Instead of copying the scripted, why not just add a post-function called "Update parameters of the Set Field Value to constant or Groovy expression Function for this transition."

"The value of field <custom_field> of the current issue will be set to the result of a Groovy expression (unless the field already has a value)."

This way, the value will not be duplicated.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

225 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you