Hello!
This is what I'm trying to achieve:
Given a sw issue
When commited
Then fetch the component from the commit and update components field as Compass Component
The problem that I have, is that when updating the Component field a non Compass Component is created and informed, even if the component exists.
I've been able to:
- Fetch the component name from a commit using text formatting smart values.
From {{commit.url}} I've follow documentation Automation smart values - text fields | Cloud automation Cloud | Atlassian Support
I save the component name on this variable {{Component}}, that I use later.
- Update the component field
Creating two variables:
{{ExistingComponents}} = {{#issue.components}}{ "name": "{{name}}"} {{^last}}, {{/}}{{/}}
{{AllComponents}} = {{ExistingComponents}} , { "name": "{{Component}}"}
Editing issue Components field:
{ "fields": { "components" : [ {{AllComponents}} ] } }
All Compass Components were overwrited and when I hover over the components I get this message:
component-name can be removed from this issue, but to add it again, switch to Jira components from the Components page.