Hello,
I have Jira and Bitbucket in the company I am working at. The purpose of this question is to automate task creation in Jira according to Bitbucket.
I created a rule in Jira Project Automation to listen webhook triggers from Bitbucket. The event is pull request : open. And webhook can be triggered with no errors. I have linked issue in Bitbucket pull request. And this issue has a link to an epic defined in our Jira project. I can automate creating new issues and assign these issues to reviewers added in pull request.
Also I want to create epic link for these newly created issues. But I couldn't access linked issue in pull request. (I can parse from webhookData.pullrequest.fromRef.displayId but can't access this issue's fields). And I can't write scripts to achieve this as well sadly. (Because of company policy I don't have direct access to virtual machine that is hosting Jira)
How can I achieve this using Jira Project Automation?
Hi @Polaris -- Welcome to the Atlassian Community!
For a question like this, it helps to post images of your complete rule, any relevant actions, and the audit log details showing the rule execution. Those provide context for the community to offer better suggestions.
Without seeing your rule...
If you have the key / id of the Epic, your rule could use the Lookup Issues action to load the data from the issue.
For Jira Data Center, this will only load a limited number of fields. If you need other issue fields, the rule would need to branch to the issue with JQL or use the Send Web Request action to call the REST API endpoint for an issue search. Seeing the specifics of your rule will help clarify what may help better.
Kind regards,
Bill
Hi @Bill Sheboy , Thank you so much!
Even without seeing the rule, your response is very helpful. Lookup Issues action is exactly what i am looking for. Unfortunately there is no action like that in my end. (It is because of we are using Jira Data Center not Jira Cloud)
I can get issue key from pull request with following smart value:
key = {{webhookData.pullrequest.fromRef.displayId.match("(\b[A-Z]+-\d+\b)")}}
If I can access this issue, I will get the epic and it will be possible to link this epic to the newly created issues.
For pictures sadly I can't provide anything for now. But the rule flow is like following:
1. Trigger Webhook from Bitbucket
2. Check reviewer count from
{{webhookData.pullRequest.reviewers.size}}
3. Create issue for each reviewer for Code Review
Summary: {{webhookData.pullRequest.title}} - Code Review
Description: Click for Pull Request : {{webhookData.pullRequest.links.self.href}}
Assignee: {{webhookData.pullRequest.reviewers.get(0).user.name}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which version of Jira Data Center are you using? I believe the Lookup Issues action was added in version 9.0
That is also when the Create Variable action was added, and that may help for extracting / saving the Epic's key.
Once you have that, it could be used to link the new issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.