In the documentation provided by Atlassian for the IssueCRUD servlet, they have hardcoded the project name as "TUTORIAL" and it only works for it.
How could we get the current project that the Jira user is currently in and use that project name inside the IssueCRUD servlet so that the IssueCRUD servlet could be used for projects with any name instead of hardcoding the project name inside the code?
SOLVED:
Add the following inside your web-item in atlassian-plugin.xml:
<link linkId="project--web--item-link">/plugins/servlet/issuecrud?pname=${helper.projectObject.name}</link>
Add the following in doGet method of IssueCRUD:
iid= req.getParameter("pname").toString();
String "iid" stores the project name.
Now, use the string "iid" inside your queries in IssueCRUD as follows:
Query query = jqlClauseBuilder.project(iid).buildQuery();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.