Hi,
I could able to fetch project id by using getFieldById("pid")
What should I use to fetch project name?
Thank you
Try this
import com.atlassian.jira.component.ComponentAccessor
Project project = ComponentAccessor.getProjectManager().getProjectObj(Long.parseLong(getFieldById("pid")))
Hi Bhushan,
Thank you for quick reply.
Your suggested method worked perfectly.
Only thing is, instead of getFieldById("pid"), I had to use projectID.getFormValue().
Here is the snippet from my code.
FormField projectID=getFieldById("pid")
Project project = ComponentAccessor.getProjectManager().getProjectObj(Long.parseLong(projectID.getFormValue()))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bhushan's solution is fine, but I prefer:
getIssueContext().getProjectObject()
getIssueContext() returns a com.atlassian.jira.issue.context.IssueContext which has other useful stuff.
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.