pull-request-notifier-for-bitbucket icon indicating copy to clipboard operation
pull-request-notifier-for-bitbucket copied to clipboard

Add new variable that finds all JIRA Issue keys related to the pull request

Open towni0 opened this issue 8 years ago • 5 comments

Hi! Would it be possible to create a new variable that finds all JIRA Issue Keys related to the pull request? This would be really useful in my current project.

towni0 avatar Jun 14 '17 11:06 towni0

Yes it would be possible. PR:s are welcome =)

tomasbjerre avatar Jun 14 '17 15:06 tomasbjerre

Just chiming in to say that this would be very useful.

I'm not a Java/Atlassian Plugin guy, so unfortunately I'm not in a position to provide a patch. At least for the time being I'm planning on calling back to Bitbucket in my pull request webhook script before I pass the message on to RabbitMQ for use by my pull request handler agents. @tomasbjerre, do you have opinions wrt. what name for the variable (PULL_REQUEST_JIRA_ISSUES?) and format (comma-delimited list of issue IDs?) that the plugin might use? That would provide guidance to those who do have the ability to provide a patch, and it would allow my infra to use the same to allow for a clean transition once the plugin supports it natively.

johntconklin avatar Jul 20 '17 20:07 johntconklin

I try to name variables by where they are found in Atlassian API:s. PULL_REQUEST_JIRA_ISSUES sounds good.

Are you requesting all jiras that are mentioned in the PR description? Or all jiras witin commit message of all commits?

tomasbjerre avatar Jul 20 '17 20:07 tomasbjerre

I'll be using the /rest/jira/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/issues REST endpoint.

johntconklin avatar Jul 20 '17 20:07 johntconklin

That REST API returns both JIRA keys (XYZ-1234) and full URLs. I only need the keys myself, but an argument could be made to provide both PULL_REQUEST_JIRA_KEYS and PULL_REQUEST_JIRA_URLS. I can imagine this being useful/necessary for users that have multiple JIRA instances attached to their Bitbucket instance.

johntconklin avatar Jul 20 '17 20:07 johntconklin