Capturing Username in Workflow Post Function

Steven Bergstein October 5, 2011

I want to capture the username of the user who executes a workflow transition using a post function (specifically, I'd like to capture the "ResolvedBy" username, which could be different from the user to whom the issue is assigned). I thought that this might be possible using a "Set field value from User Property value" post function, but I am having trouble getting this to work properly.

Is this possible? If so, how?

1 answer

0 votes
Nic Brough -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.
October 5, 2011
Ah, user properties are not what you need - they're flags that administrators add to users, nothing to do with the actual user. But you're on the right track with a siimple workflow post-function
You'll need to find or write a plugin to provide this function. To be honest, it's a popular one, so I wouldn't actually even start writing. You can do it with the scripting plugin of course, and it's a function in some other plugins too.
My current main client uses the "set custom field value" one in the "jira misc workflow extensions" combined with the macro '%%CURRENT_USER%% although they only do it with target fields that are "user pickers" (in most cases, you'll probably want that anyway)
Jon Sword
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.
October 5, 2011

The issue is tagged as "jira-studio". I thought that would preclude writing a workflow plugin or script?

(Sorry - I don't use studio so I am speculating based on discussions I have observed in the past)

Steven Bergstein October 6, 2011

It turned out that the Jira Toolkit Plugin is available to me in Jira Studio. All I had to do was to enable it, create a new custom field of type "Username of last updater or commenter" (which seems like an odd way to do this), and then capture that field's value in a post function at the appropriate point in the process.

I've also (now) enabled the Jira Suite Utilities which should allow me to clear the ResolvedBy field when an issue is reopened. These two plugins have some redundant functionality, but I'm not concerned about this.

Suggest an answer

Log in or Sign up to answer