Hello,
Is it possible with a jira automation rule to get a jira project property? You specify the project property key and you get the project property value. I already searched in the available smart values but didn't find anything.
Thanks
Hi @Luc Noppen
You can read the entity properties, as is shown here for issues: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--issue.properties--
For a project property, it would be:
{{project.properties."myPropertyName"}}
The key is context...if the trigger is for a project, use above. If instead it is for an issue you might need to explicitly call the REST API from a web request in the rule to get the project to access the properties. Before trying that, perhaps first try {{issue.project.properties."myPropertyName"}} to see if they are available.
Kind regards,
Bill
Hello,
I'll test this before accepting the answer.
Thanks for your reply.
Kind regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luc,
what do you mean to get the jira property? What is your purpose?
If you mean to edit the property in automation there is a specific section to do that.
Hope it helps.
Best,
Alberto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know this answer is tagged for Cloud, but I could use the answer for Data Center. I've tried both:
{{project.properties.snji-comments}}
{{project.legacyProperties.snji-comments}}
The value is set, as I can retrieve it with:
https://jira.company.com/rest/api/2/project/PROJ/properties/snji-comments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using Jira Cloud, not Server/Data Center, and...I wonder if you can find an issue in the project and access the properties that way with:
{{issue.project.properties.snji-comments}}
My understanding is the {{project}} smart value only works with the project-based triggers so perhaps that's why the smart value doesn't work for Server/Data Center version.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bingo! @Bill Sheboy to the rescue!
I changed the rule from using a Scheduled (project-less) trigger to using a Manual trigger, which put the execution in the context of a specific issue (and project).
Bill's smart value worked, as did one of my original guesses, as shown below.
Since this is a single-project (not Global) rule, one might reasonably wish that the project.properties... smart value would resolve to the only project that the rule is scoped to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
With your answer I'm able to set a project property and with the answer of Bill Sheboy I'm able to read the project property.
Your answers combined give me what I need.
Thanks.
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.