Hello,
do you have any suggestion how we can change name of project (only name, not key) automatically with post function? Can we do that with script runner?
Thanks,
Darko
With Script Runner you could create a custom script post function with the following script
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.UpdateProjectParameters
def issue = issue as MutableIssue
final def NEW_PROJECT_NAME = "New Project Name"
def project = issue.projectObject
if (project.name == NEW_PROJECT_NAME) {
log.debug "Project name is already updated - do nothing"
return
}
changeProjectName(project, NEW_PROJECT_NAME)
Project changeProjectName(Project project, String newname) {
def updateProjectParameters = UpdateProjectParameters.forProject(project.id).name(newname)
ComponentAccessor.projectManager.updateProject(updateProjectParameters)
log.debug "Project $project.key name updated"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Thanos Batagiannis [Adaptavist]
I find a script listenner for update a component , when i change name the component the name changed in an other project with project key ?
Thanks in advance !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Probably by using REST API. You can try webhooks to send a request.
https://developer.atlassian.com/server/jira/platform/webhooks/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will first try to solve problem with script runner. Thank you for suggestion.
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.