Hi all,
i would like to know if there is a way to catchthe previous/current values selected for a custom field of type check box or drop-down list with multiple selection.
My case is that i have 5 fields once it's updated a related issue will be created that reflect the new values, for here no problem i used the post-function, but what i need to send an email to the assignee what changes are done example
filed 1 actions:
- option1 unselected
- option2 selected
thank you.
Hi Bushar,
So in order to get the old and the new value when you update a custom field, you will need a Custom Listener that will listens for Issue Updated events and the script will look something like
import com.atlassian.jira.event.issue.IssueEvent
def event = event as IssueEvent
def changeItems = event?.getChangeLog()?.getRelated("ChildChangeItem")
def change = changeItems.find {it.'field' == "Checkboxes"}
if (change) {
def oldValue = change.'oldstring'
def newValue = change.'newstring'
// do something with them
}
Hope that sheds some light
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.