Create a work item in Azure DevOps when a GitHub issue or PR is interacted with.
Use the issues
or pull_requests
trigger in your workflow to call this action.
Optional. If specified, only issues or PRs with this label will create ADO items.
The name of the ADO organization where work items are to be created.
The name of the ADO project within the organization.
Optional tags to be added to the work item (separated by semi-colons).
Optional work item number to parent the newly created work item.
An area path to put the work item under.
Optional. The type of work item to create. Defaults to Bug.
Common values: Task, Bug, Deliverable, Scenario.
Optional. By default, the action tries to find an ADO work item that was already created for this issue or PR. If one is found, no new work item is created.
Set this to true to avoid checking and just always create a work item instead.
Optional. The product name to use for the ADO work item.
The id of the Work Item created or updated
The following environment variables need to be provided to the action:
ado_token
: an Azure Personal Access Token with "read & write" permission for Work Item.github_token
: a GitHub Personal Access Token with "repo" permissions. You can use the automatic token secret that GitHub generates at the start of each workflow job:"${{ secrets.GITHUB_TOKEN }}"
name: Sync issue to Azure DevOps work item
on:
issues:
types:
[labeled]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: MicrosoftEdge/action-issue-to-workitem@main
env:
ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
github_token: "${{ secrets.GITHUB_TOKEN }}"
with:
label: 'tracked'
ado_organization: 'ado_organization_name'
ado_project: 'your_project_name'
ado_tags: 'githubSync'
parent_work_item: 123456789
ado_area_path: 'optional_area_path'
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.