Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the project name by passing the project ID using ScriptRunner

Jose M.
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.
April 30, 2019

Jira 7.13.1 is showing the message, that "A vlue with ID '10123' does not exist for the field 'project'. I need to find the name of the project. 

I have the add-on ScriptRunner installed. Is it possible to use the script console and find the project name by passing the project ID? I assume yes, but how does the code look like?

Thanks a lot in advance for any help!

1 answer

1 accepted

1 vote
Answer accepted
Christos Moysiadis
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.
April 30, 2019

Try this :

import com.atlassian.jira.component.ComponentAccessor

def projectManager = ComponentAccessor.getProjectManager()

def project = projectManager.getProjectObj(10123)

log.error(project.getName())
Jose M.
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.
April 30, 2019

Great! It worked. Thanks a lot! 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events