jira automation accessing project properties

Luc Noppen May 24, 2022

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

4 answers

2 accepted

0 votes
Answer accepted
Bill Sheboy
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.
May 24, 2022

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

Luc Noppen May 30, 2022

Hello,

I'll test this before accepting the answer.

Thanks for your reply.

Kind regards

Like Bill Sheboy likes this
0 votes
Answer accepted
Alberto Salvante
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.
May 24, 2022

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.

Screenshot 2022-05-24 at 10.37.59.png

Hope it helps.

Best,
Alberto

0 votes
Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2023

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 
Bill Sheboy
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.
January 19, 2023

Hi @Mykenna Cepek 

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

Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2023

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.

 

ReadEntityProperty.png

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.

Like Bill Sheboy likes this
0 votes
Luc Noppen May 30, 2022

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events