Development (JIRA)How to get a project object ?

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

This widget could not be displayed.
Mizan Community Champion Mar 02, 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 .

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

do you know the relative class in .net SDK ?

This widget could not be displayed.

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.

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 5 hours ago in Europe

Topic Tuesday: How did you learn about the AUG programme?

Back in 2010 I hadn't been using the Atlassian tools (JIRA, Confluence, Bamboo) that long and I started searching online to see if I could chat to other users primarily about how they used the produc...

13 views 0 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you