How do I run a script when the value in the customfield?

How do I run a script when the value in the customfield, if the value to which the change is unknown to me.
Is that possible? Thank you in advance.

1 answer

0 votes

Could you give us more detail on:

  • when this should run.  "a value in a field" does not tell us when you want to do it.  (Think of it this way - I wrote "dave" on a note.  My note has a value of "dave".  Do I run a script when I write the note, when I throw it away, or every second that "dave" is on it?)
  • You say "if the value to which the change is unknown".  That's not an English clause, and hence makes no sense.  At a guess, you are trying to say that you want to update a custom field with some data, but the clause implies that you do not know the data.  This will not work.  Imagine that you hire someone to paint a wall.  They come to your house and ask "what colour do you want the wall?".  When you say "I don't know", they cannot do it.  That's what you have done to us here.

I'll try to explain.
I have a drop-down list, the script should be triggered when any item.

That's how I'm trying to implement it:


IssueManager issueManager = ComponentAccessor.getIssueManager();

def change = event?.getChangeLog()?.getRelated("ChildChangeItem").find {it.field == "customfield_10200"}
if (!change) { ("Developer changed" + change.oldstring ) ("Developer changed" + cchange.newstring )


But the mistake: java.lang.NullPointerException: Cannot get property 'oldstring' on null object

I'm doing something wrong, but I can not figure out what it was.


>the script should be triggered when any item

when any item what?

Your code is from a listener though, and it needs a tweak if I'm understanding what it's for.  Try


Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

375 views 1 13
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot