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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,430
Community Members
 
Community Events
176
Community Groups

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

1 vote
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

Like Azfar Masut likes this

@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

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events