when an issue is updated I'd like to save the author of the changes in a custom field

Iago Docando
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 31, 2017

That's pretty much it.

I need a custom field called "Last edited by:", or something like that.

I can not use post functions because I want the custom field updated even if there's no status transition. Also, I don't know how to capture the name of the author of the changes (i've used %current_user% in some post functions but as i've said post functions are aout of the question in this case).

Thanks in advance.

1 answer

0 votes
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 31, 2017

You need a custom listener or if you have script runner plugin installed then you need to implement an listener, which listens for issue update events and updates the custom field with the name of the event author.

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 31, 2017
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 31, 2017

Using event.getUser() you can get the author of the event and then populate the custom field with that value

https://developer.atlassian.com/static/javadoc/jira/latest/reference/com/atlassian/jira/event/issue/IssueEvent.html#getUser()

Iago Docando
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 31, 2017

Thanks a lot for the quick response. I will check out the custom listener approach as I do not have the script runner plugin installed.

The issue would be that my coding skills are quite limited to using Matlab to solve physics problems so if there's any hope to avoid coding I would prefer that.

From https://confluence.atlassian.com/adminjiraserver072/listeners-828787617.html I understand there's already a IssueEventListener (The main listener interface in JIRA, used whenever anything happens to an issue).

Could this be already what I need? I guess I'd have to modify it slightly but that's much easier than having to start from scratch.

If so... What would be the steps I should follow? How do I get that "com.atlassian.jira.event.issue.IssueEventListener" and where do I save it so I can add the new listener (.../WEB-INF/lib?)?

Please excuse any nonsense I might have said and thanks again.

Suggest an answer

Log in or Sign up to answer