Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Automation: Set person field to initiator of transition

Hi all

 

I've just migrated from JIRA server to cloud instance using team managed projects.  I'm re-building my workflow and automation rules, and thus far workflow was similar and therefore easy, but I've been going around in circles to sort out my first automation.

In server, it looked like the below where upon a transition, I would set the developer (customer person) field to the user who was the assignee at the time.

Developer automation.jpg

So in my cloud instance I've gone and setup a new person field to match, yet when I try to find the rule in the action trigger the field doesn't show.  I tried to find solutions for this with no luck, so have tried the coding option (and I'm not a coder)...

I found my custom field id to be cf[10246] so I've tried a few things but this is what it looks like and no surprise it's not working!  Maybe I'm not even close, but given my lack of experience I feel like I've had a fair crack.....

custom code.jpg

Any help would be greatly appreciated, please.

 

Thanks, Brendan

2 answers

1 accepted

1 vote
Answer accepted

So through sheer persistence and trial and error I've solved this.  Formula that worked is:

{
"update": {
"customfield_10246": [{
"add": {
"id": "{{initiator.accountId}}"
}
}]
}
}

 

Thank you @Mikael Sandberg for the post here

 

What a mission for something that took me 1 minute on the server!  

 

Thanks all of you for chipping in.  I'm exhausted!

0 votes
Sebastian Krzewiński
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 18, 2023

Hi @Brendan Sheppard 

 

I'm not sure if capital letters make difference but can you try to use {{initiator.accountId}} ?

Also what I see is that after }} there is a dot. Please remove it.

 

Regards,

Seba

Thanks for the quick reply @Sebastian Krzewiński, it's much appreciated.

I (think I) made those adjustments but it still failed.

updated JSON.jpg

Also, the error message isn't helpful, just still advises incorrect JSON. 

Elyes Gannoun _Elements_
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.
Oct 19, 2023

Hey @Brendan Sheppard ,

Just pointing out the obvious here but we never know! 
If the JSON is incorrect, could it be because of the comma you have at the end of the 4th line, next to the initiator accound Id variable?

Hi @Elyes Gannoun _Elements_  I can't code so nothing is obvious :D 

I removed that but still no luck.

I tried changing the custom field id also to "customfield_10246" as I had seen it displayed like this but that also didn't work.

Elyes Gannoun _Elements_
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.
Oct 19, 2023

@Brendan Sheppard - I tried something on my end that worked which differs a bit from what you've configured:

For an automation action "Edit issue" in the additional fields section, I've written:

{
"fields": {
"Custom field name": "Custom field value"
}
}

Just try to put the name instead.

What is the custom field 10246 type ? If it's a user type, the object must be different

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events