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

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 can I have my issue and key value for current projet

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

0 votes
Answer accepted

Hi @Aurélie Geoffroy!

Use:

getUnderlyingIssue()

as your issue

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

Thank you I will try this morning.

I ll give you feed back soon  

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)

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Asked in Jira Service Desk

Calling all Insight users, we need your help!

Hello Insight users,  As part of our (Mindville's) acquisition by Atlassian, our training team is looking to build some new Insight training materials. It would really helpful if you can ...

97 views 1 0
View question

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