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 the project key in a ScriptRunner Behaviour

I need to retrieve the current issue's project in a Behaviour groovy script.

I tried using this:

   def myContext = getIssueContext()

but the ScriptRunner interpreter complains that it does not find the method.

I added an import of com.atlassian.jira.issue.context.IssueContext but I still get the same error.

Any idea?

1 answer

1 accepted

2 votes
Answer accepted
def proj = underlyingIssue?.getProjectObject()

This should do the trick 

and it does, thanks

Like Will C likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Now Available: AWS Service Catalog Connector for Jira Service Desk

We are excited to share that AWS Service Catalog Connectors for Jira Service Desk (JSD) Cloud and JSD Server/Data Center are now available in the Atlassian Marketplace. Users can now request admin-ap...

369 views 0 1
Read article

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