Hi,
I am trying to migrate my projects to a new workflow scheme, which has an updated Sub-Task workflow.
I have specified old status : new status mapping in the script. But, despite this, post migration, the sub-tasks are not working as expected (Though they are in the new workflow, they are behaving odd , like unable to move them through any status). We have used this same script to migrate other issue types without problem. Any thoughts on what we might be missing, or should sub-tasks be dealt differently ?
Here is a snippet of the logic,
if(source){
if(project){
def issues = ComponentAccessor.issueManager.getIssueObjects(ComponentAccessor.issueManager.getIssueIdsForProject(project.id));
issues.each{issue ->
if(issue.getIssueType().getName() == "Sub-Task"){
def oldStatus =issue.getStatus().getName()
def newStatus = subtaskMapping[oldStatus]
if(newStatus){
Status destinationStatus = constantsManager.getStatusByNameIgnoreCase(newStatus);
workflowManager.migrateIssueToWorkflow(issue as MutableIssue, subTaskWF, destinationStatus)
}
Hi @Aisha M
I'm well, nice to hear from you :)
I'm not sure if the problem is related to that but I'd suggest two things at first glance.
1. reindex the issue after the migration
if (newStatus) {
Status destinationStatus = constantsManager.getStatusByNameIgnoreCase(newStatus)
workflowManager.migrateIssueToWorkflow(issue as MutableIssue, subTaskWF, destinationStatus)
issueIndexingService.reIndex(issue)
}
2. Not related to the problems but it's a best practice. I'd call removeSchemesFromProject and addSchemeToProject once per project (not issue). So I'd change
if(source){
if(project){
to
if (source && project) {
I hope this helps
@Tuncay Senturk _Snapbytes_ Thank you for the reply ! That didn't make a difference.
I think it appears like, the sub-task is showing the new workflow scheme in the project configuration, but while moving through statuses, it still seems to follow the status of the previous workflow .
We have used the same script & logic to migrate Story, Bugs and few other issue types with no problem. Only sub-task seems to have this problem.
Ironically, when I ran a different script to directly make changes to the workflow scheme. that seems to work and move the Sub-task. But that was not practical unfortunately, because, around 1000+ projects use the scheme and that ran for around 15hrs . . This method of moving projects to a different workflow scheme with the new workflow, along with the mapping took around 2 hrs max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tuncay Senturk _Snapbytes_ I was able to figure out and it was such a silly mistake :D :D
It was supposed to be if(issue.getIssueType().getName() == "Sub-task") with a lower case "t" instead of "Sub-Task" . . I didn't know jira was this case sensitive :O
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ohh!, I would not find that. Thanks for letting me know. Yes, Jira is sensitive and case sensitive :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aisha M ,
Can you log 'Status destinationStatus = constantsManager.getStatusByNameIgnoreCase(newStatus); and provide us the details'
Need to Confirm:
1. The status is correctly returned?
2. New workflow is published with required changes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Piyush Annadate _ACE Pune_ Thank you for this suggestion. I was able to figure out the sub-tasks were not being processed only after adding logs. Definitely helped me pin point the problem :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello '@Antoine Berry @Tuncay Senturk _Snapbytes_ Hope you are well and good !!!! :) I just wanted to know if you experts have any thoughts that might really help me :)
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.