forcedotcom / git2gus

A Github application to keep issues in sync with Agile Accelerator
https://lwc-gus-bot.herokuapp.com
BSD 3-Clause "New" or "Revised" License
27 stars 16 forks source link

Document how to unlink a work item from its GitHub issue #85

Open edmorley opened 4 years ago

edmorley commented 4 years ago

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:

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?