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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.