Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

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

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.
Nov 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.
Nov 20, 2018

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)

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.
Nov 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
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.
Jun 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