Simple Dashing widget (and associated job) to display open pull requests for a specific Project and/or repository from Atlassian Stash
See the example.png below for an idea on how this widget looks on a dashboard.
None
This widget provides two presentation styles;
- A Pull request summary for a project, where all repositories are listed along with the number of open pull requests
- A pull request detail for a specific repository, where the title and original author is displayed
To use this widget, copy stash_pull_requests.html, stash_pull_requests.coffee, and stash_pull_requests.scss into the /widgets/StashPullRequests directory. Put the stash_pull_requests.rb file in your /jobs folder.
To include the summary widget in a dashboard, add the following snippet to the dashboard layout file:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="stash-pull-requests" data-view="StashPullRequests" data-title="Pull Request Summary"></div>
</li>
To include the detailed widget in a dashboard, you include the following snippet in your dashboard, where the data-id indicates the project and repository slugs you'd like to show requests for;
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="stash-pull-requests-myproject-myrepo" data-view="StashPullRequests" data-title="Open MyRepo Pulls" style="background-color:#96bf48;"></div>
</li>
For example, in the snippet above, the view would show all open pull requests for the "myrepo" repository contained within the "myproject" project.
The following values can be updated to reflect your own configuration requirements;
- STASH_URI = URI.parse("http://stash:7990")
- STASH_USER = 'stash'
- STASH_PWD = 'stash'
Stash is checked every 30 minutes, but you can change that by editing the job schedule.
I had to name the directory
widgets/stash_pull_requests/
instead ofwidgets/StashPullRequests/
to make it work.