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 fetch issue key in scriptrunner

Hi,

I have a specific requirement, where we want to do some processing (on the issue) behind the scene once a file is attached to the issue.

I am trying to achieve this through scriptrunner plugin. I am able to catch the event once the file is attached. I am also able to fetch that particular attached file in my script but I am not able to find the issue key for the issue where that file is attached. Unless, i have the issue key, I can't change the issue fields in my script.

Please help on how this can be achieved. Note that i am using Jira Service Desk Cloud version.

Regards,

Zeeshan Malik

1 answer

0 votes
Ismael Jimoh Community Leader Nov 25, 2020

Hi @Zeeshan Malik 

Please try the getKey() method.

def myIssue = event.issue
def myIssueKey = myIssue.getKey()

Something like this should work if you are fetching from an event.

If it is from a workflow, they a simple issue.key should normally return your issue key.

Regards. 

Ismael Jimoh Community Leader Nov 25, 2020

Apparently for Jira cloud, you should be able to use issue.key as suggested here: https://scriptrunner-docs.connect.adaptavist.com/jiracloud/script-listeners.html#_issue_created

Hi,

Can we get the issue on "Attachment created" Event on script listener (script runner cloud version) as there is no "event" keyword defined! all i can find are following variables

baseUrl

logger

attachment

timestamp

webhookEvent (type: String in our case the value is attachment_created)

regards,

Sheeraz

Hello, can someone help on this? This is Urgent?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

133 views 0 4
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