How to update source summary after the ticket exalated

Originally asked by Rodolfo So on 07 September 2022 (original question)


Hi

Is it possible to update source summary after exalated via scriptrunner? I found this article below but I can’t see the code where the fields is being updated. Please advise.

https://docs.idalko.com/exalate/x/UoBZ

Thanks


Answer by Ezequiel Consorti on 07 September 2022

Hi Rodolfo,

As per the document you would need to include the script mentioned in point 5.

Regarding the updates you want to instruct to the listener to perform when an issue is exalated, you need to implement the rules in the if(). In your case, you would need to include the rules to update your source summary in that if().

Please let me know if you have any additional questions.

import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.event.type.EventType
import com.atlassian.jira.event.type.EventTypeManager
import com.atlassian.jira.issue.Issue
 
import org.slf4j.Logger
import org.slf4j.LoggerFactory
 
class DefaultAccountListener extends AbstractIssueEventListener {
 
    private final Logger LOG = LoggerFactory.getLogger(DefaultAccountListener)
 
    private static final String EXALATED_EVENT_TYPE = "com.exalate.api.domain.trigger.EXALATED"
    private static final String EXALATE_UPDATED_EVENT_TYPE = "com.exalate.api.domain.trigger.UPDATED"
 
    @Override
    void customEvent(IssueEvent event) {
        Issue issue = event.issue
        EventType eventType = eventTypeManager.getEventType(event.getEventTypeId())
        LOG.debug("Custom event caught for issue ${issue.key}: type [${eventType.type}], name [${eventType.name}], nameKey [${eventType.nameKey}]")
 
        if (eventType.name.equalsIgnoreCase(EXALATED_EVENT_TYPE)) {
            LOG.debug("EXALATED event caught for issue ${issue.key}")
        }
    }
}