Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update Custom Field (Project Labels) with values with automation

Edited

Hello community,

I'm new in Jira. I did install de App "Project Labels" using extra labels for my issues. Now I setup a automation rule for creating a new issue after a the first issue is Done.

Below the automation rule (sorry it is in dutch 🙃 )

The field is named "Project Label" and is also used in the JQL query for the IF statement. 

When I setup the values for creating a new issue I try to find the "Project Label" field but it isn't there. So I think I need to update/add this value in the advanced section using JASON.

I'm not really familiar with JASON so I did try it several times but it doesn't work.

 

Can any body help me out? I want tot add/update the Project Label field with the value "Jaarlijks" and "Operationele Planning"

 

Thank you very much :-)

 

Gert-Jan

  

 

 

automation-rule.jpgfield-not-listed.jpg

project-labels-isnot-there.jpg

 

insert-JASON.jpg

 

2 answers

0 votes
Alex Koxaras Community Leader Dec 15, 2021

Hi @Gert-Jan Turnhout _ MicroFix and welcome to the community!

Project labels, as tested them on my instance, receive a  long number instead of a string as Jira labels do. So, in order to add a label you have to add this json:

{
"update": {
"customfield_10151": [{"add": 2}]
}
}

Where you have to replace the customfield ID with your own label id, and you have to find out the ids of your labels. This can be done if e.g. you send an API request to get the issue in a json format:

https://YOUSUBDOMAIN.atlassian.net/rest/api/3/issue/ISSUE_KEY

This request will return a payload in which you will find the values of your labels. And once you find them, replace them on the first code I've pasted.

Alex

@Alex Koxaras Hello Alex, thank for your answer. If I understand well, I cann't use the field name "Project Label" (this works in de JQL query) but I have to find out the "customfield ID" using the API request you gave.

I understand that I have to fill in my onwn "SUBDOMAIN" but what do I fill in at het ISSUE_KEY?  My tried my project code (im my case GMS) but notting received

I got the message : {"errorMessages":["De issue bestaat niet of je hebt geen toestemming om hem te bekijken."],"errors":{}}

What do I wrong?

Alex Koxaras Community Leader Jan 18, 2022

Hi @Gert-Jan Turnhout _ MicroFix and sorry for the later reply, but I am kinda busy this period :/

About the ISSUE_KEY, you can use ANY issue key you want, in which you have already include some labels. E.g. ABC-123.

Suggest an answer

Log in or Sign up to answer
TAGS

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