I created a script in script listener when an attachment is created in a Jira issue it converts the attached file in base 64 . This converted file i must send in a ServiceNow incident. To do this i need to find the Jira issue number from where i must extract de incident number. I tried different solutions but i am unable to get the jira issue id (key) Can somebody help me with this issue?
I tried this script but i have errors
Hello ,
First of all it would be less agressive if you start your question by "I would like " instead of "I want"
Second, the way to extract the ke of an issue as long as you get the correct issue object you need that information from .
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First of all i apologize for how i put the question ( apologize for the " I want")
I tried that method that you suggested me but i have this message
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error is on from your event object which is not recognised not the GetKey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry i am a beginner in Jira script runner(listener) if i ask you nicely can you help me with my problem? here is a full description of the issue. I was asked to interconnect Jira cloud with Service Now. The task that was assigned to me is that when in a Jira issue is added an attachment, that attachment must be sent to an incident in Service Now (incident that created the Jira issue) I realized that an attachment can be sent to Service Now just if is coded in Base 64 (this part of the script is working well) , but i do not know how to get the Jira issue key or id to read from that issue the incident number. When i created the script listener on the section: On these events: i put the argument When an attachment is created.
I hope that you understand what i tried to explain and i hope that you can help me.
Thanks in advanced.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
screen capture will help to understand where you are runing that script and your script code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And this is the script that i tried to make:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to get your Issue object from the event context first as below :
Issue issue = event.getIssue()
def issueKey = issue.getKey()
Then you can get the issue key or any other issue properties
regarsd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.