Originally asked by Jonathan on 02 November 2021 (original question)
Task types will not update when a user changes the type.
We have a number of task types as follows:
Local | Replica |
---|---|
Task | Task |
Field Task | Field Task |
Digital Task | Digital Task |
Design Task | Design Task |
Sub-task | Sub-task |
Field Sub-task | Field Sub-task |
Digital Sub-task | Digital Sub-task |
Design Sub-task | Design Sub-task |
These are syncing but when an user identifies that a task is the wrong sort and changes it, ie from Digital to Field. This change is not synced.
Tasks are syncing using incoming code:
if(firstSync){
issue.projectKey = "*PROJkey*"
// Set type name from source issue, if not found set a default
issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
}
issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey ?: issue.project?.key)?.name ?: nodeHelper.getIssueType("incident")?.name
Subtasks are set up using : https://docs.idalko.com/exalate/display/ED/How+to+sync+tasks+and+subtasks+in+Jira+Cloud
incoming code:
if(firstSync && replica.parentId){
issue.typeName = "Sub-task" //Make sure to use the right subtask type here.
def localParent = nodeHelper.getLocalIssueFromRemoteId(replica.parentId.toLong())
if(localParent){
issue.parentId = localParent.id
} else {
throw new com.exalate.api.exception.IssueTrackerException("Subtask cannot be created: parent issue with remote id " + replica.parentId + " was not found. Please make sure the parent issue is synchronized before resolving this error" )
}
}
This one is copied for each sub-task type.
Comments:
Serhiy Onyshchenko commented on 03 November 2021
Hello, Jonathan ,
Thanks for raising this on community.
Do all Task types have the same workflow (do all the sub-task types have the same workflow as well)?
Regards, Serhiy.
Jonathan commented on 03 November 2021
Hi Serhiy,
Yes the only difference between them all is the name and icon. It is simply to be able to easier distinguish the different work for teams and quicker filtering by Task type.
Elyashiv commented on 04 November 2021
Hi Serhiy Onyshchenko,
We have the same need.
What do we need to change in the code so the sync rule will sync the issue type too?
Are there any other requirements besides that the workflows of both issue-types will be the same?
Thanks,
Elyashiv