forcedotcom / forcedotcom/git2gus
Document how to unlink a work item from its GitHub issue
- Dominant language
- JavaScript
- Stars
- 28
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
On https://lwc-gus-bot.herokuapp.com there is a section that describes how to manually link a GitHub issue to an existing work item.
However:
* there's no mention of how to unlink a work item (in case the link was added mistakenly, or no longer wanted)
* trying to guess how to unlink the work item is hard, since the docs don't currently mention how Git2Gus tracks the links (which could be based on metadata, or Git2Gus could be stateful)
From reading the source it appears that Git2Gus uses the work item `related_url__c` field to store state, and that unlinking differs depending on whether the work item was automatically created or not.
For manually linked work items, it seems that they can be unlinked by simply removing the `@W-1234@` mention from the issue description:
https://github.com/forcedotcom/git2gus/blob/dbe8c53c7bf703d7607ca595ef0a473a843eb3b9/api/actions/unlinkWorkItem.js#L13-L27
However for automatically created work items, there will not be a `@W-1234@` mention in the issue description, since Git2Gus does not add one itself (only adds a GitHub comment saying "new work item created: LINK" etc). As such it seems to unlink these, one has to first add the `@W-1234@` to the issue description and then remove it again, which should trigger the unlink.
I'm presuming also that another way to unlink either of the above cases, would be to manually edit the work item in GUS and clear the `related_url__c` field?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.