I need to get Priority value using Priority name.
Hello,
Where do you need this info? By using Jira Java Api or Jira Rest API? Or somehow else?
Using java API. @Alexey Matveev
It would be like this:
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.priority.PriorityPriority priority = ComponentAccessor.getConstantsManager().getPriorityObject("priority name")
Dear @Alexey Matveev
That method will not work, because getPriorityObject() accept priority id, not name.
Hello @Ramesh Lakshmanasamy
You can get priority like this
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.priority.Prioritydef constantsManager = ComponentAccessor.getConstantsManager()Priority priority = constantsManager.getPriorities().find {it.name == "High"}
Thanks for your answer @Mark Markov.will let you know after try above solution.
@Alexey Matveev i am getting null while using getPriorityObject().
Thanks @Mark Markov
@Mark Markov its not worked.
This method for sure return Priority object, may be you need priority id?
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.issue.priority.Prioritydef constantsManager = ComponentAccessor.getConstantsManager()Priority priority = constantsManager.getPriorities().find {it.name == "High"}def id = priority.id
It looks like you're new here. Sign in or register to get started.