Hi All,
I know that Issue.GetProjectObject() , returns the project the issue relates to, but in create issue screen, the issue context is not null but I can not get the ProjectObject?
Im programming a control behavior and need to know at create stage what is the current project the create is for.
Thanks
You can get the project id from ActionContext like this:
(String[]) ids = ActionContext.getParameters().get("pid"); String pid = ids[0];
And then use the id to get the project object.
done I have the ID, but how to get the project key ? the object it self?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ComponentManager().getInstance().getProjectManager().getProjectObj(Long Id); this will return the project.
You will have to cast your pid into long and pass as a parameter to the above method . You can refer the api docs .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Try the below code it might help
import org.ofbiz.core.entity.GenericValue import com.atlassian.jira.issue.Issue; GenericValue project = issue.getProject()
I have used this in one of my postfunction which works before the issue is created .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ProjectActionSupport projectSupport = new ProjectActionSupport();
Project currentProject = projectManager.getProjectObj(projectSupport.getSelectedProjectId());
System.out.println("The Name For Current Project: " + currentProject.getName());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The JiraWebActionSupport.java has a method called
getSelectedProjectObject()
So if your java program extends this action, simply call this method like
Project project = getSelectedProjectObject();
which will give you the last accessed project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.