Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Custom field context update event

Guy Incognito
Contributor
November 23, 2023

Hi all,

 

I have a SR listener that I use to detect stuff that 'escapes' from JIra audits, such as status renaming, and sends me Slack notifications.

Now I'd like my script to be able to detect changes produced on custom fields context, for instance if a custom field is assigned to/removed from a project or issuetype.

I didn't find information about which class has to be imported to get that event data, until now I've found only a way to detect when the cf is edited (by pressing the EDIT button), but not when its context is altered (by pressing the CONFIGURE button).

This is a snippet of my current listener code:

import com.atlassian.jira.event.issue.field.CustomFieldUpdatedEvent
if(event instanceof CustomFieldUpdatedEvent){
eventName = 'Custom Field Updated'
eventObject = event as CustomFieldUpdatedEvent
entityName = eventObject.getCustomField().getUntranslatedName()+"(id: "+eventObject.getCustomField().getId()+")"
entityDetails = "*Original field name*: \n"+eventObject.getOriginalCustomField().getUntranslatedName()+"\n*New field name*: \n"+eventObject.getCustomField().getUntranslatedName()+"\n*Original field type*: \n"+eventObject.getOriginalCustomField().getFieldTypeName()+"\n*New field type*: \n"+eventObject.getCustomField().getFieldTypeName()+"\n*Original field description*: \n"+eventObject.getOriginalCustomField().getUntranslatedDescription()+"\n*New field description*: \n"+eventObject.getCustomField().getUntranslatedDescription()
}

Thanks in advance

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2023

Hi @Guy Incognito

In your description, you mentioned:-

Now I'd like my script to be able to detect changes produced on custom fields context, for instance if a custom field is assigned to/removed from a project or issuetype.

I didn't find information about which class has to be imported to get that event data, until now I've found only a way to detect when the cf is edited (by pressing the EDIT button), but not when its context is altered (by pressing the CONFIGURE button).

Unfortunately, this is not doable. Even if you configure it to a Generic Event, modifying the field context will not trigger any change.

Thank you and Kind regards,

Ram

Guy Incognito
Contributor
November 27, 2023

Thanks for clarifying it @Ram Kumar Aravindakshan _Adaptavist_ 

TAGS
AUG Leaders

Atlassian Community Events