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 to fetch the Priority of current issue in JIRA?

Requirement: This will be applicable for all the issues of a given project. There is a customfield Promised Delivery Date in the form. Based on the priority of an issue, this field has to be enabled/disabled for the user.

When the priority = Critical, the customfield has to be disabled. Otherwise it will remain enabled. Hence I wanted a groovy script to fetch the current issue's priority. I have done with the enable/disable part.

 

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 01, 2021

Not tried it recently, but assuming you're using Behaviours, then

def prio = getFieldByName('Priority')
def prioValue = prio.value

Should get you the name of the current value selected for priority

0 votes
Ismael Jimoh
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.
Jul 01, 2021

Hi @Pranita Warik 

Normally depending on where you are getting it from, you can either use:

issue.priority //When you are doing this from the workflow
issue.getPriority() //every where even the above defaults to this in reality.

Read more about this here: https://docs.atlassian.com/software/jira/docs/api/7.1.2/com/atlassian/jira/issue/Issue.html

Regards

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events