-
Notifications
You must be signed in to change notification settings - Fork 44
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using the link-jira automation rule, the link is incorrect.
To Reproduce
Steps to reproduce the behavior:
- The
.cmautomation file
manifest:
version: 1.0
triggers:
on:
- pr_created
- commit
provider: jira
orgName: <myorg>
{% set ticketid = "" %}
{% for ticket in tickets %}
{% if (ticket | includes(regex=r/.+/)) %}
{% set ticketid = ticket %}
{% endif %}
{% endfor %}
automations:
link_jira:
if:
- {{ is.approved_author }}
- {{ has.jira_ticket_in_title or has.jira_ticket_in_branch }}
run:
- action: add-comment@v1
args:
comment: Issue Tracker Link - [{{ticketid}}]({{tracker[provider].baseurl}}{{ticketid}})
has:
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }}
jira_ticket_in_branch: {{ branch.name | includes(regex=tracker[provider].pattern) }}
is:
approved_author: {{ pr.author | match(list=[ 'github-actions', 'dependabot', '[bot]']) | nope }}
tracker:
jira:
baseurl: https://[orgName].atlassian.net/browse/
pattern: r/\b[A-Za-z]+-\d+\b/- The PR URL (as it contains the repo and PR identifiers)
The PR is used with the following branch:
feature/MP-1400 - Describe your PR relevant content
The PR description is being generated by thelinearb_ai_descriptionautomation rule - Add relevant commit SHAExpected behavior
A clear and concise description of what you expected to happen.
I would expect the link url be<a href="https://myorg.atlassian.net/browse/MP-1400" rel="nofollow">MP-1400</a>
Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working