Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 get Issue's Project Key with post function in jira cloud?

Hi,

I need to save the Project Key in a variable when I create an Issue.

I've tried issue.project.key and also issue.projectKey  but doesen't work

how to do it?

 

Thanks

1 answer

Hi @erika_zanoni

Welcome to the community!

If I have understood your requirement correctly. You can use the Create issue post function and the substitution variable %original_project% while setting the custom field. Let me know if you have any questions.

Disclosure: I am the product manager for Create on Transition for Jira Cloud.

Thanks,

Nishanth T

Hi Nishanth,

I'm doing a scriptrunner post function and I need to use the JQL Search API to find some issue, for this reason I need to create a Variable and use that in the JQL expression like: "Project = ${variable}"

I need to get the Project Key from the Issue I have created, because the post function start after the creation of that issue. I can get the issue key doing issue.key, there is a similar way to get che project key?

Thanks

Hi Erika,

I can confirm that this is not possible t create a variable that can be used in a JQL search as Atlassian does not support variables being passed into a JQL query.

I can confirm that when you create an issue you can reference the issue object which comes in the binding of your script and below this you will be able to get the issue key and you can then write some logic to strip away all characters after the - character as this will give your project Key as Atlassian do not store the project key below an issue so this is the only way to get it with ScriptRunner for Jira Cloud.

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
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