Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I have my issue and key value for current projet

Aurélie Geoffroy November 16, 2018

Hi how can Have my key and my issue ? with scriptrunner --> Behaviour

// importation
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueKey
//import com.atlassian.jira.util.ImportUtils

// instanciate constructor ??? Key=Dossier  issue=-17  Dossier-17(projectname)
def key = ? get something ???
def issue = ? get something what is something ??

// instanciation avec le constructeur
def mainIssue = new IssueKey(key,issue)
def f = mainIssue.getIssueNumber()
def g = mainIssue.getIssueNumber()

// formfield
def box = getFieldByName("test2")
box.setFormValue(f)


//Thank you

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Deleted user November 20, 2018

Hi @Aurélie Geoffroy!

Use:

getUnderlyingIssue()

as your issue

Deleted user November 20, 2018

If you want to use the values on the screen use getIssueContext()

Aurélie Geoffroy November 21, 2018

Thank you I will try this morning.

I ll give you feed back soon  

Aurélie Geoffroy November 21, 2018

WORK THANK YOU SO MUCH !!!!

// importation
import com.atlassian.jira.issue.Issue
def key2 = getUnderlyingIssue().getKey().toString()    // WORK :D

// formfield
def box2 = getFieldByName("test3")
box2.setFormValue(key2)

Aurélie Geoffroy November 26, 2018

Simpson :)

Like Deleted user likes this
Azfar Masut
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2022

@[deleted] sorry to ask, but im a beginner.

 

Can you explain what's the difference between 

log.debug('This issue underlying: ' + getUnderlyingIssue())

log.debug('This issue context: ' + getIssueContext())

 

Both seems to be returning same output. I'm confused

TAGS
AUG Leaders

Atlassian Community Events