I can able to set permission scheme to the project which is created through UI where as i am not able to set to the project which is created programmatically we can set but if due to some resons not setted and trying to add through UI i am getting Nullpointer exception.
getting following error
java.lang.NullPointerException at com.atlassian.jira.projectconfig.contextproviders.ProjectPermissionContextProvider.getContextMap(ProjectPermissionContextProvider.java:85) at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.initContextMap(CacheableContextProviderDecorator.java:70) at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.getContextMap(CacheableContextProviderDecorator.java:46) at com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel.getHtml(DefaultWebPanelModuleDescriptor.java:141) at com.atlassian.jira.projectconfig.tab.WebPanelTab.getTab(WebPanelTab.java:75) at com.atlassian.jira.projectconfig.servlet.PanelServlet.outputTab(PanelServlet.java:163) at com.atlassian.jira.projectconfig.servlet.PanelServlet.doGet(PanelServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:42) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:52) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.core.filters.HeaderSanitisingFilter.doFilter(HeaderSanitisingFilter.java:44) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.labs.botkiller.BotKillerFilter.doFilter(BotKillerFilter.java:36) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.executeRequest(AccessLogFilter.java:104) at com.atlassian.jira.web.filters.accesslog.AccessLogFilter.doFilter(AccessLogFilter.java:88) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.jira.security.xsrf.XsrfTokenAdditionRequestFilter.doFilter(XsrfTokenAdditionRequestFilter.java:54) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77) at com.atlassian.jira.web.filters.SitemeshPageFilter.doFilter(SitemeshPageFilter.java:124) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)
any one have any idea ??
Thanks,
after creating project, i am using following jelly tag to set permission scheme through jelly script runner
<jira:SelectProjectScheme projectKey="JIRA" permission-scheme="JIRA Permission Scheme"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
When creating a project via SOAP, you need to provide a permission scheme and you can't simply send a string. It needs to be a {{remotePermissionScheme}} object because when that gets converted to the SOAP XML format in the request it will look different than just a string and that's what JIRA expects.
For example:
final RemotePermissionScheme permissionScheme = new RemotePermissionScheme(); permissionScheme.setId(0L); final RemoteProject project = soapy.createProject(token, "TESTD", "Test Proj D", "", "", "contour", permissionScheme, null, null);
The above will work while the below wont:
final RemoteProject project = soapy.createProject(token, "TESTD", "Test Proj D", "", "", "contour", null, null, null);
The permissionScheme can't be a string, it needs to be a permissionScheme SOAP object with the id of the permission scheme filled in.
Cheers,
Pedro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response!
Actually i created project through post function not through SOAP
following code i am using to set permission scheme
UpdateProjectSchemesValidationResult schemesResult = projectService.validateUpdateProjectSchemes(loggedInUser,permissionSchemeId,notificationSchemeId,issueSecuritySchemeId);
errors.addErrorCollection(schemesResult.getErrorCollection());
if (!errors.hasAnyErrors()) { // adding schemes to Project projectService.updateProjectSchemes(schemesResult, newProject); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't mind me saying this, it looks terribly odd trying to create projects in post functions :(
Can you give a bit more details into the usecase (while I accept that I am not solving your problem by asking this)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Renjith,
we are getting number of requests to create new projects based on existing project so i created post function to create project and copy all the configurations from the base project. all the configurations are copied as expected and i am facing the problem while copying permission scheme.
some times it is copying from base project and some times it is not and it is setting null, when i am trying to change null value to some other schem getting the NPE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, you created a project via Jira API. Obviously something is missing there. Where do you have that NPE ? Can you post the stack trace ? Otherwise, I'm not sure that you will get an answer right away.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
any help on this?
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.