/ Published in: Groovy
after this is added into the custom REST endpoints for scriptrunner, you can run it this way: /rest/scriptrunner/latest/custom/updateLead?userName=USERNAME&projectKey=PROJECTKEY
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import com.atlassian.jira.ComponentManager import com.atlassian.jira.project.ProjectManager import com.atlassian.jira.project.Project import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate import groovy.json.JsonBuilder import groovy.transform.BaseScript import javax.ws.rs.core.MultivaluedMap import javax.ws.rs.core.Response @BaseScript CustomEndpointDelegate delegate updateLead( httpMethod: "GET", groups: ["jira-administrators"] ComponentManager componentManager = ComponentManager.getInstance() ProjectManager projectManager = componentManager.getProjectManager() String userToElevate String projectToFind Project theProject try { } } try { } } try { theProject = projectManager.getProjectObjByKey(projectToFind) } } Project updatedProject = projectManager.updateProject(theProject, projName, projDesc, userToElevate, projUrl, projAssignee ) }