Hi All,
when I update the summary of an issue (new or after an edit) via a groovy post function, the summary on the card on a Kanban board is not reliably updated. The summary changes in the issue and the detail view to the right, but the card on the board itself is not affected until it is edited or transitioned for the next time.
Here is the code I am using:
def im = ComponentAccessor.getIssueManager();
def issueToChange = im.getIssueObject(issue.id) as MutableIssue
issueToChange.setSummary(summaryString)
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def userManager = ComponentAccessor.getUserManager();
def user = userManager.getUserByName(currentUser.name)
im.updateIssue(user, issueToChange, EventDispatchOption.DO_NOT_DISPATCH, false)
I have discovered though that if I change the updateIssue() call to dispatch an Event
im.updateIssue(user, issueToChange, EventDispatchOption.ISSUE_ASSIGNED, false)
then everything works as expected. Unfortunately, as I am using a Listener to listen for many Issue event types, this leads to problems in preventing infinite loops, where I currently have to disable my script for the ISSUE_ASSIGNED event type (as this is the least important to me).
This feels very much like something that will eventually come back to bite me hard ;-)
So my question is: Can I either dispatch a custom event somehow (instead of ISSUE_ASSIGNED) or alternatively, is there some other way to trigger the cards on the kanban board to update themselves from a post function?
Regards
William
import com.atlassian.jira.event.type.EventTypeManager
EventTypeManager eventTypeManager = ComponentAccessor.getEventTypeManager()
def allEventTypes = eventTypeManager.getEventTypes()
def customEventType = allEventTypes.find { it.name == "Name of your custom event" }
Long customEventTypeId = customEventType?.getId()
im.updateIssue(user, issueToChange, customEventTypeId , false)
Once you have your customEventTypeId, you can just supply it in your update method
Any feedback that may help me find a solution is appreciated, like if anyone knows which events exactly cause the board cards to be updated. I assume all of this is somehow related to caching.
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.