Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • HTTP Status 500 - Exception occurred while rendering template 'templates/jira/appconsistency/jiralocked.vm'.

Add a value in Components part of a project

Deleted user
June 9, 2017

Hi guys, 

I am trying to develop a groovy script (post function) which add a value in Components part of a Project.

I  have the following error :

No signature of method: com.atlassian.jira.ComponentManager.getProjectComponentManager() is applicable for argument types: () values: []

 

create(String name, String description, String lead, long assigneeType, Long projectId)

 I think the problem come from the fourth parameter, I have put 0 because I don't know how to get the right value.

 capture script.PNG

Here is my code : 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.bc.project.component.ProjectComponent
import  com.atlassian.jira.bc.project.component.ProjectComponentManager

OptionsManager optionsManager = ComponentAccessor.getOptionsManager()
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
ComponentManager componentManager = ComponentManager.getInstance()

//MutableIssue issue = issue
def issue = ComponentAccessor.getIssueManager().getIssueObject("CTY-213")


def userProjectId = 13900
def component = componentManager.getProjectComponentManager().create("test toto","description","leadtoto",0,userProjectId)

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 1, 2015

That error suggests that Tomcat is running, but you've relocated JIRA in such a way that it can't find the installation.

I think you need to go into the exact detail of what was changed when your admins changed the hostname, and what you did in JIRA to adapt to it.

Yvan Zeebroek
September 2, 2015

Thank you for a swift reply. I think the only thing what could be still wrong is the base URL location of the JIRA instance - which is accessed through the admin panel. Is there another way to change the base URL- so that it at least looks at localhost port 8080

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 2, 2015

An incorrect base url will just warn you that it is incorrect in the browser. It is not the cause of this problem I'm afraid - you've changed a lot more than that, and it looks like your installation is completely broken.

Renuka Venkata Ramani Challa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 19, 2015

Yvan : Were you able to fix it? I face the same issue.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 19, 2015

The lack of response suggests that they fixed whatever they'd broken in Tomcat without our help.

0 votes
Pilar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 1, 2015

Try rebooting the server and restarting the application again. Run a ipconfig /dnsflush command on the client.

If all changes have been rolled back the reboot and restart should work.

For future my recommendation would be to test such critical changes first on a test instance.

Pilar

Yvan Zeebroek
September 2, 2015

Thank you for this feedback. Unfortunatelly it did not solve my problem, but I will for sure take your recommendations into account.

Suggest an answer

Log in or Sign up to answer