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

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
Cristian Rosas [Tecnofor]
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.
November 20, 2018

Hi @Aurélie Geoffroy!

Use:

getUnderlyingIssue()

as your issue

Cristian Rosas [Tecnofor]
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.
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)

Cristian Rosas [Tecnofor]
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.
November 21, 2018

Glad to hear! Do you wish to look as happy as me? Well, you've got the power inside you right now. So, use it, and send one dollar to Happy Dude, 742 Evergreen Terrace, Springfield. Don't delay, eternal happiness is just a dollar away.

Happy dude

Like Azfar Masut likes this
Aurélie Geoffroy November 26, 2018

Simpson :)

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

@Cristian Rosas [Tecnofor] 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