A concise DangerJS plugin for Atlassian products.
Key features:
- Bitbucket Cloud: support to add PR tasks and reviewers conditionally.
Install into your repo alongside Danger:
npm install --save-dev danger @atlassian/danger-plugin-atlassianOr with Yarn:
yarn add --dev danger @atlassian/danger-plugin-atlassianThis plugin exposes a small set of helpers designed to be used from your Dangerfile when running against Bitbucket Cloud pull requests.
- Your CI/Danger run must have Bitbucket Cloud context (Danger exposes
danger.bitbucket_cloud). - Use Danger’s
schedulehelper for asynchronous work inside your Dangerfile.
// dangerfile.ts
import { schedule } from 'danger'
import { addTasks, addReviewers } from '@atlassian/danger-plugin-atlassian'
// Add reviewers by AAID (Atlassian Account ID) - use https://id.atlassian.com/gateway/api/me to retrieve yours
schedule(addReviewers(['117058:9c6d0119-0000-1111-2222-0000d7399fff']))
// Add PR tasks only if not already present (idempotent per run)
schedule(addTasks([
'Please add unit tests for the new utility',
'Update the README with usage examples',
]))- Adds one or more PR tasks whose raw content matches the provided strings.
- Idempotent per run: the helper fetches existing tasks and only posts the ones that are missing.
- Adds reviewers by their Bitbucket Cloud AAIDs.
- Merges with the current reviewer list and de-duplicates before updating the PR.
- Errors: non-OK responses from the Bitbucket API cause the helper to throw with HTTP status information.
- Example AAID:
557058:9c6d0619-9999-1111-2222-73e0d7399fff.
See package.json scripts for linting, building and testing.
Contributions are welcome! Please see CONTRIBUTING.md for details.
Copyright (c) [2025] Atlassian US., Inc. Apache 2.0 licensed, see LICENSE file.
