The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Development (JIRA)How to get a project object ?

wajdhaikal
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 Champions.
March 2, 2012

I have project ID/key, I need a way to get the project object but not from the issue object because I'm in the create new issue context the GetProjectObject will not work in this context

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Mizan
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 Champions.
March 2, 2012

ComponentManager().getInstance().getProjectManager().getProjectObj(Long Id); this will return the project.

You will have to cast your project id into long if its in String type and pass as a parameter to the above method . You can refer the api docs .

Asmaa Samra
July 4, 2017

i'm using jira SDK for .NET , but i can't find ComponentManager class.

do you know the relative class in .net SDK ?

1 vote
Wojciech Seliga
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 Champions.
March 4, 2012

You can inject com.atlassian.jira.project.ProjectManager interface and the use getProjectObjByKey or some other variant of getProjectObj* method.

Note that using ComponentManager in JIRA 5.0 is not recommended and in this circumstances where you cannot inject dependencies, you should rather use ComponentAccessor class.

wajdhaikal
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 Champions.
March 4, 2012

Thanks Wojciech Seliga but I have JIRA 4.4. Is ok now in my case I will consider your comment for future.

TAGS
AUG Leaders

Atlassian Community Events