I'm having an issue with Jira Expressions. I'm unclear on how to use if statements.
Goal: I've got an issue type of "Groundwork" that uses a workflow that is standard for all subtasks. When this groundwork status is updated to "Complete", I want to check that all sibling subtasks are assigned (because this is just part of the responsibilities for the person who completes the groundwork task). If any are Unassigned this transition should fail.
Steps Taken:
Problem:
passesCondition = true
// if issue is groundwork type
if (issue.issueType.name.match('^(Groundwork)$') != null) {
// get parent
parentIssue = issue.parent
// get subtasks
def subTasks = parentIssue.getSubTaskObjects()
// for each subtask
subTasks.each {
// if not assigned
if (it.assignee == null)
passesCondition = false
}
}
passesCondition Questions:
1. How can I translate the code above to Jira Expressions?
2. Are there any other alternatives, without Jira Automation?
It is not an option in JIRA yet. However, latest version of Bitbucket server is coming with webhooks. You might be able to take advantage of it and push the story to another status by triggering a REST call from Bitbucket server on PR approval.
Haven't tried it yet but worth checking.
Has anybody tried using REST calls for getting a trigger in Jira on Pull Request approval ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sowmya Srinivasapura Devaraja and @Jobin Kuruvilla [Adaptavist],
Do you guys have any example of those Bitbucket REST calls?
Thanks
Carlos
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.