youngmon/atlassian-qna huggingface dataset:
Create automation between Discovery project to Software project
Asked by Eran Roiter:

Hey all,  

Does anyone know how can i create automation for Discovery project, there's a link that called Delivery tickets that i can relate Idea to an epic in the Software project.

i want to create an automation that once the epic in the Software project change status to in progress the Idea in the Discovery project will change status from Product idea to in Development.

tried few things, nothing worked.  

Thanks !


Answers:
author: Bill Sheboy
body: Hi [@Eran Roiter](/t5/user/viewprofilepage/user-id/5289455)

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

I hypothesize your rule is triggered on a change to the delivery issue in the software project, and that the rule scope is in that project. And so it cannot see / act on the JPD Idea.

This rule will need to have multiple-project or global-scope to access the issues in the different projects. Your Jira Site Admin will need to help do that as changing the scope configuration of a rule is a global admin feature for rules.

Kind regards,  
Bill


Tags: jira

jira-product-discovery

link
Jira Automation lookup issues
Asked by Wing:

In Jira Automation, I used \`{{lookupIssues.customfield_10001}}\` to query and get the value \`\[652354565fvf56585cggh, 45628456ghkg55668ghh\]\`. I want to use Advanced Edit to apply this value to another multi-user custom field \`customfield_10002\`. How can I format this value in JSON to be \`{"id": "652354565fvf56585cggh"}, {"id": "45628456ghkg55668ghh"}\`?


Answers:
author: Trudy Claspill
body: Hello [@Wing](/t5/user/viewprofilepage/user-id/5573169)

Welcome to the Atlassian community.

When asking for help with an Automation Rule it will make it easier for us to help you if you show us screen images of your complete automation rule with details of each step.

Otherwise, refer to this documentation which includes an example:

<https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-user-picker-custom-field>


author: Rick Westbrock
body: My first thought is that you need to enclose the two values in square brackets (aka put them in a list) similar to how they were returned. I think that typically this is how multiple values are added to a field:

```
"customfield_10002": [{"id": "652354565fvf56585cggh"}, {"id": "45628456ghkg55668ghh"}]
```
Automation rule to work based on new issues relating to old issues
Asked by Ryan teo:

Hello Team,

I'm quite new to the whole automation on Jira so bear with me, what I'm trying to do is when I receive a new issue created with the summary of VPN Tunnel Down, to create an issue but when a new issue is created with the summary of VPN Tunnel Up, to either link both issues together based on the device name and close or to close both tickets at the same time. is this possible ? and if so how can I be done? much appreciated, if you need any more details do not hesitate to ask


Answers:
author: Bill Sheboy
body: Hi [@Ryan teo](/t5/user/viewprofilepage/user-id/5572948) -- Welcome to the Atlassian Community!

That is possible using the Issue Created trigger and rule conditions to check the fields, perhaps using an if / else condition for the different paths.

I recommend reviewing the documentation basics for rules and smart values, and then trying to create your rule. If you run into challenges, post images of your complete rule and the audit log details, and explain what is not working as expected.

To get you started on creating your rule, please refer to these documentation and example sources:

* <https://www.atlassian.com/software/jira/guides/automation/overview#what-is-automation>
* <https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/>
* [https://www.atlassian.com/software/jira/automation-template-library#/rule-list?systemLabelId=all\&page=1\&pageSize=20\&sortKey=name\&sortOrder=ASC](https://www.atlassian.com/software/jira/automation-template-library#/rule-list?systemLabelId=all&page=1&pageSize=20&sortKey=name&sortOrder=ASC)
* <https://support.atlassian.com/jira-software-cloud/docs/use-advanced-search-with-jira-query-language-jql/>

Kind regards,  
Bill
Creating token for a user
Asked by Eran Roiter:

Hey all, i would like to know what can i do in this situation  
I asked IT to create a user and set him as admin so he can use a Token.

the thing is that is its only mail and not a real user, how can i accept the invite for Jira use, so i can enter as org admin to this user and create a token.  

Or if anyone have other idea i can use in this case?  

Thanks!


Answers:
author: Matt
body: If it's a real mail account, can your admin set up mail forwarding to forward that new account to your account? This way, you'll receive the invite email and then be able to move forward with token creation. Once it's all set up you can disable the mail forwarding.

comments: author: Trudy Claspill
body: Note that Organization Admins cannot create an API token on behalf of another user.

You must login as the user itself to make an API token for a user.


author: Matt
body: Yes! That is an important detail to note.


Tags: jira

token

users
We have Content Archiving through which i would like to set owners and put expiration date
Asked by Satty:

We have Content Archiving through which i would like to set owners and put expiration date at page level, so if the process is expiring annually the set owner should get a reminder a month in advance. How do i do that at page level? Also I set owner using the question mark sign, I press save when it opens and then If i open the page again I can see it f=green tick or exclaimer? what is that ? How can i make sure that all my pages have a standard sign to start with and the user set the owners? thanks


Answers:
author: Bill Sheboy
body: Hi [@Satty](/t5/user/viewprofilepage/user-id/5567089)

Are you using a marketplace addon for Confluence content archiving? If so, you may want to check that product's documentation to see what automation capabilities are available to support your needs.

Kind regards,  
Bill
Use a lookup table within a lookup issues loop
Asked by Matt Caruso:

I'm working on an automation which sends a Slack message with a summary of the results of a Lookup Issues search.

I'm trying to pull a value from a Lookup table (which converts the issue type name to a Slack icon name) and it doesn't work. It seems to not render the results from the lookup table.

```
*Completed this week:*
{{#lookupIssues}}
{{icons.get(issueType.name)}} <{{url}}|{{key}}>: {{summary}}
{{/}}
```

![Screenshot 2024-08-15 at 10.34.54?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/341984i7DA217A52BE15BAB/image-size/large?v=v2&px=999 "Screenshot 2024-08-15 at 10.34.54?AM.png")

Is it possible to call a lookup table from within a lookup issues loop?


Answers:
author: Bill Sheboy
body: Hi [@Matt Caruso](/t5/user/viewprofilepage/user-id/5569167) -- Welcome to the Atlassian Community!

Short answer: no. Within an iterator, no other data is visible.

For your scenario, there are a few workarounds, and the simplest one may be to not use the lookup table. Assuming your lookup only contains those types, you could do this:

```
*Completed this week:*
{{#lookupIssues}}
:jira-{{issueType.name.toLowerCase()}}: <{{url}}|{{key}}>: {{summary}}
{{/}}
```

Kind regards,  
Bill

comments: author: Matt Caruso
body: Brilliant! That worked perfectly.
Better way to retrieve Jira Issue Keys from Gitlab
Asked by Davyd Derkach:

Hello everyone!

I have a Jira integration with Gitlab, as well as some automation on screenshot below that receive a Jira Issue Keys related to current release tag from webhook, parse them, send a message to Slack and preform simple transition:  

![image_2024-08-14_103835128.png](https://community.atlassian.com/t5/image/serverpage/image-id/341658iFD2C589655A52E69/image-size/large?v=v2&px=999 "image_2024-08-14_103835128.png")  

Here the webhook that i use to send Jira Issue keys that related to current release from my pipeline:

*curl -X POST -H 'Content-type: application/json' --data '{"data": {"keys": "BDO-392,BDO-391"}}'<https://automation.atlassian.com/pro/hooks/>\<your-webhook\>* **Question:** So I am wondering is there a way to receive Jira Issue keys as well as some metadata such as Release Engineer name, release date and Jira Issue Summary in some other way rather that running script and sent this information via Webhook URL?   
I found that there some "smart values" that should be available after integration with Gitlab:

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/>  

But I am wondering whether these values are available and how to use them to sent message to slack with following information:

Jira Issue keys related to current release tag as well as some metadata such as Release Engineer name, release date and Jira Issues Summary.


Answers:
author: Adolfo Casari
body: [@Davyd Derkach](/t5/user/viewprofilepage/user-id/5550816)You can include all data you need in the json payoad.

Take a look to this:

<https://confluence.atlassian.com/jirakb/working-with-incoming-webhook-data-in-automation-for-jira-1125878776.html>

comments: author: Davyd Derkach
body: [@Adolfo Casari](/t5/user/viewprofilepage/user-id/853257)

Thanks for your reply. I am already using **`{{webhookData}}`** `` smart value to parse my webhook body.``  

``But my question is other: Is in my case it`s a correct way to use a script that sends the Jira Issue keys t``hat related to current release`` to my automation rule via webhook like this:``  

*curl -X POST -H 'Content-type: application/json' --data '{"data": {"keys":*`` "BDO-392,BDO-391"}}'``<https://automation.atlassian.com/pro/hooks/>``<your-webhook>``  

``Maybe it`s possible to not use script and get all needed values:``  
Release Engineer name, release date and Jira Issues keys that related to current release?


Tags: gitlab

integration

smart-value

webhook
Need help on defining the email content for automation
Asked by Sanjay Dangi:

![IMG_20240815_123756.jpg](/t5/image/serverpage/image-id/341898i34F44A4ED4B27CC4/image-size/large?v=v2&px=999 "IMG_20240815_123756.jpg")

Hello All,

First of all, Apologies for the quality of picture

I have created an automation so as to get a notification whenever a new jira issue is added to a closed or cancelled epic.

The automation is working for me. However, I am looking for below four informations in the mail:

1. Impacted EPIC : closed/ cancelled epic that was added with new jira issue

2. Triggering Issue : issue that triggered this automation

3. Creator : whoever triggered this event

4. Moved/ cloned/ created : whether the triggering issue was moved from other epic/project or it was cloned from the existing epic or it was created new.

While I am able to take care of the first 3 points. Need help with #4, if at all any smart value that i can use for this?

Thanks,


Answers:
author: John Funk
body: Hi Sanjay,

I would create two separate rules - that should make number 4 very easy then. You can add it to the existing one, then copy the rule and adjust for the other trigger.

comments: author: Sanjay Dangi
body: Hello John,

What do i need to do to create a separate rule for 4? If you can guide me please


author: Bill Sheboy
body: Hi [@Sanjay Dangi](/t5/user/viewprofilepage/user-id/5451233)

In addition to John's suggestions...

There are two errors in your current rule in the Send Email action's content: in the triggering issue line, the URL and summary are instead referring to the Epic as they are missing the {{triggerIssue}} prefix.

Consider changing that line to this:

```
Triggering Issue: {{triggerIssue.key}}?{{triggerIssue.url}} and summary -?{{triggerIssue.summary}}
```

Kind regards,  
Bill


author: Sanjay Dangi
body: Thank you bill for the suggestions.

Could you also suggest as to how should I go for #4!!

Thanks again,

Sanjay


author: Bill Sheboy
body: *First thing, I am using Jira Cloud and not Server / Data Center, and that is what you are apparently using. Please investigate your version and test accordingly. With that out of the way...*

When using the multiple events trigger as you show, the rule has less information available. Try using the specific triggers to gain more information...

If you use the Issue Moved trigger instead, you at least know the issue was moved from another project. For Jira Cloud, the smart value expression {{#changelog.project}}{{fromString}}{{/}} will indicate the source project. I do not know if that works for Server / Data Center.

When issues are Cloned with Jira Cloud, a clones link is added. If that also applies with Jira Server / Data Center, the link could be used to identify the source issue when the Issue Created trigger is used.


author: Sanjay Dangi
body: Thank you Bill


Tags: cloud

jira
Number of issue properties using {{issue.properties}}?
Asked by Serge Kravchenko:

Hi All,  
It looks like {{issue.properties}} smart value returns a JSON object.  
I would like to do some list-based operations on these properties, such as getting the number of properties or finding properties that start with a certain substring.  
For this, I was thinking of converting {{issue.properties}} from JSON to a list.  
Is there a way to do that?  
Thank you!


Answers:
author: Bill Sheboy
body: Hi [@Serge Kravchenko](/t5/user/viewprofilepage/user-id/5567547) -- Welcome to the Atlassian Community!

In my experience, some smart value content in automation rules which appears to be JSON or list values is neither of those things. The only way to know is to attempt to parse them.

Have you tried using list operations on your specific issue property?

If that did not work, have you tried using match() or split() to transform the values into a list?

If you only need the number of properties for a specific issue, perhaps call the REST API endpoint to get the property keys: <https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-properties/#api-rest-api-3-issue-issueidorkey-properties-get>

Kind regards,  
Bill

comments: author: Serge Kravchenko
body: Hi Bill, thank you so much for your response!  
Yep, I tried using list properties such as size and string methods such as match(). Neither of them worked, so I concluded that the value is a JSON object. :(  


author: Bill Sheboy
body: The match() could be encountering challenges if there are any embedded formatting characters in the content, such as newlines causing the regular expression to halt processing. One workaround for that is to replace such characters prior to match attempts.

Without seeing the specifics of the content in that smart value, I recommend reviewing it to identify where / on-what a split() could be used to produce a list.


author: Serge Kravchenko
body: Hi Bill, I don't think any of these methods are available for a JSON object which {{issue.properties}} seems to return. I tried them, they don't return anything.


author: Bill Sheboy
body: It is unclear to me of that smart value always contains JSON or if it is plain text. If it is JSON and contains a list, it should be capable of iteration and list function usage.

I recommend writing the smart value to the audit log, then experimenting by picking text within the result to use with the split() function.


author: Bill Sheboy
body: Hi [@Serge Kravchenko](/t5/user/viewprofilepage/user-id/5567547)

Just checking in...were you able to try writing the returned properties to the log to find how to parse them?

To just count them, this seems to work by converting them to text and then splitting.

* action: create variable
  * name: varIssueProperties
  * smart value: {{issue.properties}}
* action: write to the log
  * the count is: {{varIssueProperties.split(", ").size\|0}}

Thanks!


Tags: json

property

smart-value
how to set the CustomField value of an "Array" type field in C# ?
Asked by Andrej191:

hi,

I am using Atlassian SDK to create issue. I have a problem setting a value for a custom field. It always ends with this error :

**"customfield_15870":"Invalid format. Expected an array of objects with either an Option ID or an existing value."**

I use something like this to set the custom field value

```
string name = "my_field_name";
string value = "my_field_value";

issue.CustomFields.Add( name, value);
```

I also tried to create the value like this:

```
string value = $"{{\"value\":\"{value}\"}}";
```

```
string value = $"{{\"id\":\"{value_id}\"}}";
```

but nothing helped. I also tried to use the issue.CustomFields.AddArray method , but it also failed.

This problem only occurs with one particular custom field. There is no problem with the others.

Thanks for any advice.


Answers:
author: Andrej191
body: Solved via REST API. The problematic field was the custom field "cascading select". I do not think there is a way to set it using the Atlassian SDK, but the REST API can be used as a workaround.

comments: author: Bill Sheboy
body: Hi [@Andrej191](/t5/user/viewprofilepage/user-id/5566420) -- Welcome to the Atlassian Community!

As you solved your own question, do you want to mark this one as "answered"? That will help others in the community with similar needs find solutions faster. Thanks!

Kind regards,  
Bill


Tags: cloud
Using conditional logic to remove "_"
Asked by Gilad Waldman:

Hello Community,

Fighting this one up to a point i could really wish some help..

I have an automation rule that triggers every time a new customer is added to a list from Salesforce. It is than look for spaces and replaces them with "_" as it will be transform to a label field.

![1.png](https://community.atlassian.com/t5/image/serverpage/image-id/341108iA4DBC8CF0143E8DC/image-size/large?v=v2&px=999 "1.png")

At this point i run on each customer, validate it, adding specific comments and update the label field.

My problem is that sometimes i get a space at the beginning of the customer name, causing it to be looking like "_Customer" instead of "Customer"

Been trying to use multiple ways (2 examples), but none are working....

1. {{#if(({{Custo}}.startsWith("_")),({{Custo}}.substringAfter("_")),{{Custo}})}}{{/}}

2. {{#if(issue.customfield_10193.replace(" ","_").startsWith("_")),(issue.customfield_10193.replace(" ","_").substringAfter("_")),(issue.customfield_10193.replace(" ","_"))}}

Any idea how can i break the list based on spaces and also validate no space at the beginning?


Answers:
author: Bill Sheboy
body: Hi [@Gilad Waldman](/t5/user/viewprofilepage/user-id/5405912)

What are some examples of the contents of your customfield_10193? That may help to decide when / how to perform the replacement of spacing to underscores.

For example, some possible configurations might be:

1. Alice *(Single value, with no delimiter)*
2. Alice Jones *(Single value with first and last name, and no delimiter)*
3. Alice Jones, Bob Smith, Eve *(Multiple names with a comma-space delimiter)*
4. Alice Jones,Bob Smith,Eve *(Multiple names with a comma delimiter)*
5. etc.

From what you describe, I suspect it is a variation of #3, where the delimiter between names is a comma followed by a space.

In that case, you could try:

* change the source so the delimiter is only a comma
* replace the delimiter first in the advanced branch source, such as with:

```
{{issue.customfield_10193.split(", ").join(",").replace(" ","_").split(",")}}
```

Kind regards,  
Bill

comments: author: Gilad Waldman
body: Thank you very much [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

You are correct, my source is similar to #3 and looks like it works with new branch source.

Thanks!
automation : How iterate on API REST Forms format/answers
Asked by M?lanie Liguet:

Hi,

I need to retrieve some form fields in JSM request description

For this, I created an automation, which uses the API REST Forms

*format/answers* returns me the answers entered by the customer.

This works, but I can't create a loop on the number of responses, which forces me to hard-code multiple GET()

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/340735iE2CB8D6E3D27C02B/image-size/large?v=v2&px=999 "Capture.PNG")

this is not very clean. Can you explain to me how to iterate on the results?

regards,


Answers:
author: Marc - Devoteam
body: Hi [@M?lanie Liguet](/t5/user/viewprofilepage/user-id/4533707)

What information is logged in the variable, are this multiple options?

If they are do an advanced branch in the rule based on the variable, then send the web request and edit action in the branch.


author: Bill Sheboy
body: Hi [@M?lanie Liguet](/t5/user/viewprofilepage/user-id/4533707)

*First thing, I am not currently using JSM and so my suggestions are based on what I know about automation rules, in general. With that out of the way...*

You seem to be using this endpoint for getting the answers in the simplified format: <https://developer.atlassian.com/cloud/forms/rest/api-group-forms-on-issue/#api-issue-issueidorkey-form-formid-format-answers-get>

That one seems to indicate looping over the body, but you show what appears to be lists of labels and answers separated within the body.

Is that what you see if you write the entire {{webhookResponse.body}} to the audit log?

Next, what are you trying to do with the information as you iterate over it?

Kind regards,  
Bill

comments: author: M?lanie Liguet
body: Hi,

Yes i use this apir rest.I I call it to have only the customers' responses rather than the entire form.  
I retrieve the question webhookResponse.body.label and the response webhookResponse.body.answer.

The goal is to allow the support team to be more responsive by directly displaying the information they need

the api does not allow to have the number of results returned

I don't use {{webhookResponse.body}} because it is not formatted and therefore not very readable and I have useless information for the team such as the id or the choice

regards


author: Bill Sheboy
body: If you try writing {{webhookResponse.body}} *to the audit log when the rule runs*, it may indicate how to iterate over the values, producing something more useful for the team.


author: Bill Sheboy
body: Hi [@M?lanie Liguet](/t5/user/viewprofilepage/user-id/4533707)

I wanted to follow-up to learn if you had tried other parsing options yet. Perhaps something like this:

```
{{#webhookResponse.body}}
* label: {{label}} with an answer: {{answer}}
{{/}}
```

Thanks!
conditional display of field
Asked by sreenivasulu gundagula:

**If "3rd Party Vendor Hosted" equals "Yes"** Then **Vendor Contact** Info should be visible  

<br />

<br />

**If "3rd Party Vendor Hosted" equals "NO or NA"**

Then **Vendor Contact** Info should not be visible  

<br />

![example.png](https://community.atlassian.com/t5/image/serverpage/image-id/340432i85BB9B8293488D61/image-size/large?v=v2&px=999 "example.png")


Answers:
author: Trudy Claspill
body: Hello [@sreenivasulu gundagula](/t5/user/viewprofilepage/user-id/5562680)

Welcome to the Atlassian community.

Conditional display of fields based on other fields is not something that can be managed with Automation Rules.

For that you need a third party app. One app that might help you, depending on other factors of your scenario, is Behaviours for ScriptRunner.

[https://marketplace.atlassian.com/apps/1228522/behaviours-scriptrunner-for-jira-cloud?tab=overview\&hosting=cloud](https://marketplace.atlassian.com/apps/1228522/behaviours-scriptrunner-for-jira-cloud?tab=overview&hosting=cloud)