Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,059
Community Members
 
Community Events
165
Community Groups

Is the only way to move the transitioner name into a custom field to write a script?

Edited

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

 

1 answer

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. 

Thanks.  Is either free?

I see Advanced, but not sure where to go from there (list of actions is below).  I don't suppose Edit Issue would work?

Edit issue
Update certain issue fields.

Advanced

Create variable
Define a new smart value to use in this rule.
Delete attachments
Selectively delete attachments from issues.
Log action
Add value to the audit log.
Lookup issues
Search for issues using JQL.
Re-fetch issue data
Re-fetch any issues that have been updated
Set entity property
Sets a property on a given entity like an issue, user or project.

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.

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)?

 


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}}" }
}
}
      
 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

35 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you