Add current user by enter a comment
Hi Fidel, I'm looking for a functionality in workflow that automatically added the current user name after a user has enter a comment.
Toolbox has to add: Comment was created by : Andreas Beekma
I found the "Copy a parsed text to a field" and I can copy the %{Current user} to every space in JIRA but every "comments" be ignored.
What I do wrong ?
Example: "The following text parsed in basic mode will be copied to Last comment: %{Current user} This feature will be run as Current user."
Comments (7)
-
repo owner -
repo owner Hi Andreas, just released version 2.1.33 fixes a bug in "Transition's comment" virtual field. Please, try this new version, and let me know it it solves this issue.
-
repo owner Sorry, Andreas, I confused "Transition's attachments" with "Transition's comment". The bug fixed in version 2.1.33 affected to "Transition's attachments".
-
reporter Hi Fidel. I test it with the new version and it's works.
The special way to use the script in JIRA service desk, it doesn't work. When I start the transition via SD Portal. In JIRA SD directly it works. see atchment.
-
reporter -
repo owner Hi Andreas,
Sorry for the delay in my response. There is a solution for your use case: use "Copy a parsed text to a field" post-function with the following configuration:
Text to be parsed is:
matches(%{00109}, ".*Comment was created by:.*") ? %{00109} : %{00109} + "\n Comment was created by: " + %{00164}
Note that:
- %{00109} is field code for "Last comment"
- %{00164} is field code for "Last commenter"
Regards,
Fidel
-
repo owner - changed status to resolved
Hi Andreas. I close the issue. Please, reopen it if you need more support about it.
- Log in to comment
Hi Andreas,
You can use "Copy a parsed text to a field" post-function with the following configuration:
Text to be parsed in this post-function is:
Where:
Once configured, your transition will look like this:
WARNING: Be careful to insert your post-function AFTER "Add a comment to an issue if one is entered during a transition." post-function, like shown in the former screenshot.
This solution works only for comments introduced in transition's screens, i.e., if the user insert comments by editing the issue, it won't work, since "Copy a parsed text to a field" post-function only works when the transition were its inserted is executed.