I'm currently running on JIRA 6.3.1 and 3.0.16 of ScriptRunner and seeing a weird behaviour.
I'm trying to detect which field changed with the below code.
def cusField = getFieldById(getFieldChanged())
log.debug("Form field object returned is: " + cusField)
def newValue = cusField.getValue()
log.debug("Form field object returned is: " + cusField)
I then go and make a change in a customfield but when I look at the logs for the debug output I see it saying another field changed.
Any ideas what can be going on?
Thanks in advance.
Hi Randy
So the getFieldChanged() always returns the field ID of the field the behaviour fires for. So for example if you have assigned a behaviour in the Description field, the following condition will be true.
getFieldChanged() == "description" //id for the field Description
Hope that makes sense
regards, Thanos
Thanks for the quick response Thanos. Sorry to ask a follow up question but going with your description field example, if description field is not updated should this behaviour still proceed? That is what it seems like is happening to me. I update another field yet I still see this behaviour in the log file printing out.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Randy,
No this shouldn't happen. Could you please attach a screenshot of your behaviour's configuration ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
cheers Randy that's enough, I'll have a look later.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Randy,
Apologies for the delayed response. I did give it a chance and could not reproduce this. Do you have any other behaviours assigned (maybe a clash between them) ?
regards, Thanos
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.