Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,132
Community Members
 
Community Events
168
Community Groups

Project Smart Value in script

Edited

Hi 

I am looking to write a rule that if a field changes in any project, the access of that project will also change. For this, I used the Projected Update Field section and I also got help from the Script Runner program for the action, but for the access of the project to limit automatically, I need to give it the project key first, since the role can be executed for any project, I don't have a default value for it, can you help me how to get the key of the project in which a field has been changed ?

2 answers

0 votes

Hi @Maahshid Vaziri 

Context is important for smart values like Project:

  1. {{project}} by itself works for project-related triggers, and
  2. when you have an issue trigger/branch, you instead use {{issue.project}}

Which of those applies for your rule's trigger?

Kind regards,
Bill

Hi @Bill Sheboy 

I think I didn't express my problem well, after the rule is executed, I want to limit access to the project with the script runner program, for this purpose, I need to see by scripting which project was the rule executed on (actually I need the project key for this.) But smart values don't work in scripting, and I don't know how to get the project key that the rule is run on it.

If it helps, I should say that the rule is executed when a custom field is changed in the project. That is, we don't know which project it is by default, we want this role to be executed whenever a specific field is changed in any project.

I am unclear how to do that.

Would you please clarify the problem you are trying to solve by limiting project access after a field changes?  And, what does "limit access to the project" mean to you?

Perhaps if you update your question to address those things the community will have more ideas how to help.  Thanks!

0 votes
Tansu Akdeniz Community Leader Aug 10, 2022

Hi @Maahshid Vaziri 

It seems that there is space btw project and .key. Please double check it.

{{project.key}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-projects/ 

Hello @Tansu Akdeniz 

Thanks for your support but, I think I didn't express my problem well, after the rule is executed, I want to limit access to the project with the script runner program, for this purpose, I need to see by scripting which project was the rule executed on (actually I need the project key for this.) But smart values don't work in scripting, and I don't know how to get the project key that the rule is run on it.

If it helps, I should say that the rule is executed when a custom field is changed in the project. That is, we don't know which project it is by default, we want this role to be executed whenever a specific field is changed in any project.

Suggest an answer

Log in or Sign up to answer