- Hung Nguyen
- Oct 31, 2019
- connector-onpremise-jira
- Comment
4 answers
- 10-1
Can we limit the type of links that can be sync-ed?
Since it may happen that one side has more link types than the other, we wouldn't want to see sync error if one side is adding a link that does not exist in the other side.
So safe-handling rule must be allowed here.
CommentAdd your comment... - 10-1
If one side is using a linkType that does not exist in the other side, the sync will fail. is there any way to ignore in that case, don't need to sync if the linktype is not an existing linktype in the remote site?
CommentAdd your comment... - 10-1
I tried this, and:
- For existing bugs, adding a new link will see the new link sync-ed over to the other sides successfully. This is expected.
- But for creating bug on Server side, then in Cloud side the issue can not be created, the error is
..... Summary can not be null ...
Sounds like the issue.summary row was not applied.
So I copied the lines
- issue.summary = replica.summary
- issue.description = replica.description
from the Update section into the firstSync section, then the error went away. I just don’t understand why we have to have that duplication:
if(firstSync){ // If it's the first sync for an issue (local issue does not exist yet) // Set project key from source issue, if not found set a default issue.projectKey = "TEST" // Set type name from source issue, if not found set a default issue.typeName = "Task" issue.summary = replica.summary issue.description = replica.description return CreateIssue.create( replica, issue, connection, issueBeforeScript, traces, blobMetadataList, httpClient, syncRequest ) { IssueLinkSync.receive(replica, issue, httpClient, nodeHelper) } } issue.summary = replica.summary issue.description = replica.description issue.comments = commentHelper.mergeComments(issue, replica) issue.attachments = attachmentHelper.mergeAttachments(issue, replica) IssueLinkSync.receive(replica, issue, httpClient, nodeHelper)
Is there any way to do better?
Thanks
Hung
- André Leroy-Beaulieu Castro
Hi Hung,
In a regular sync you would be able to only have the summary and description synced outside the first sync block because the first sync block gets executed and then the rest of the script gets executed as well so the summary and description are still being synced upon creation, but when you call CreateIssue.create(), that's the exact moment where the issue is being created, and if the summary and description are not available to be synced before that, you will get that error.
Best regards,
André
- Hung Nguyen
So from what you said. If I want to sync issueLink, there must be a change in the overall config, because for issueLink sync, we must call CreateIssue.create() ourselves and after that, all the other rules are ignored. If we don't sync issueLink, then we don't need to call CreateIssue?
- André Leroy-Beaulieu Castro
Hi Hung,
It's not that the other rules are ignored when you call CreateIssue.create(), it's just that the issue can't be created if the summary and description are not available before you call CreateIssue.create(), but the rest of what you said holds true, if you're not syncing issue links, you don't need to call CreateIssue.create().
Thanks,
André
CommentAdd your comment... - 10-1
Hi Hung,
Thanks for the question.
I believe the Jira Cloud side should look like this:
Data Filter:
IssueLinkSync.send(replica, issue, httpClient)
and Incoming Processor:
if(firstSync){ // If it's the first sync for an issue (local issue does not exist yet) // Set project key from source issue, if not found set a default issue.projectKey = "TEST" // Set type name from source issue, if not found set a default issue.typeName = "Task" return CreateIssue.create( replica, issue, connection, issueBeforeScript, traces, blobMetadataList, httpClient, syncRequest ) { IssueLinkSync.receive(replica, issue, httpClient, nodeHelper) } } issue.summary = replica.summary issue.description = replica.description issue.comments = commentHelper.mergeComments(issue, replica) issue.attachments = attachmentHelper.mergeAttachments(issue, replica) IssueLinkSync.receive(replica, issue, httpClient, nodeHelper)
The Create issue part should only be executed in the first sync block, and the receiving of issue links should be executed on both creates and updates. Let me know if this sorts things out for you!
Thanks,
André
CommentAdd your comment...