Is the only way to move the transitioner name into a user picker custom field to write a script? If so, how do I write and apply the script? My post functions are:
1. Set issue status to the linked status of the destination workflow step.
2. Add a comment to an issue if one is entered during a transition.
3. Update change history for an issue and store the issue in the database.
4. Re-index an issue to keep indexes in sync with the database.
5. Fire a Issue Created event that can be processed by the listeners
Hi @Phil Bustin
Have you tried using Jira Automation in the project you want to apply this logic to?
Trigger: on any transition
Action: Edit issue fields and select advanced using this json:
{
"fields": {
"customfield_10037": { "id": "{{initiator.accountId}}" }
}
}
To answer your question on how to add the script:
You'll need one of the plugins that allow you to script, like PowerScripts or ScriptRunner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see Advanced, but not sure where to go from there (list of actions is below). I don't suppose Edit Issue would work?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) It would appear that I can't simply select the custom field and update it; I have to select the advanced option, correct?
2) In the documentation for advanced, I see that I can use the actual field name instead of a field Id.
3) The documentation appears to indicate that the accountId is a smart field, and works as written. Is that correct? If I get as far as activating the workflow and trying it out, I may get my answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When I tried to publish the rule, I got an error:
Additional fields contains invalid field(s) in 'update' or 'fields' section: Business Analyst Signoff
I resorted to selecting the field (not More options > json), and selecting myself as the value. That worked.
What was wrong the the json I created (same as your example, but with the name of the field instead of the field Id)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wouter:
1) I saw documentation that says I can use the custom field name instead of "customfield_10037". Do you think that's correct? Again, when I tried that, it didn't work.
2) If I try "customfield_10037", for which I assume I'd have to find the custom field Id and substitute it for 10037, where can I find the Id?
3) Is initiator.accountId the equivalent of the transitioner, and is 'accountId' sufficient, with no Id replacing it?
{
"fields": {
"customfield_10037": { "id": "{{initiator.accountId}}" }
}
}
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.