The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
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