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
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 _Relational_ 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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Alex Koxaras _Relational_ find with API the right customfielID and also the correct value for the JSON script to ADD/UPDATE de customfield with the correct value.
Automation woks for me. Thank for you help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finally find the custom Field ID using: https://mydomein.atlassian.net/secure/admin/EditCustomField!default.jspa?id=10062
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.