youngmon/atlassian-qna huggingface dataset:
Custom Field JSON works On Change Value not On Issue Create?
Asked by Ron Koudijs:

Why does below JSON ++not++ work On Issue Create, while it ++does++ work On Change Value?

{ "fields": { "summary": "Use my custom field: {{MyField}}" } }


Answers:
author: Bill Sheboy
body: Hi [@Ron Koudijs](/t5/user/viewprofilepage/user-id/4212901)

* Would you please clarify what problem you are trying to solve?
* And, when you note it does not work on issue create, what do you observe happening?

I note you posted this question in the automation area; are you doing this with an automation rule? If so, there are known race-track issues with issue create triggers. One work-around is to re-fetch the issue before processing to ensure the data is present. For example:

* trigger: issue created
* action: re-fetch issue
* ...continue with your rule processing

Best regards,  
Bill

comments: author: Ron Koudijs
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

Yes, I am trying to change the summary field with automation. For the summary I want to use custom fields. I tested the JSON code with a "When value changes for" + "Edit issue fields". That works fine. But the same JSON code with a "When issue created" does not give a result.

I am going to try your re-fetch suggestion.

Thanks for helping.

Regards,

Ron


author: Ron Koudijs
body: I found the reason of my problems. We are using Dynamic Forms from Devinity. The issues I am having trouble with are created before the Dynamic Forms is filled by the customer. Deviniti suggest a work around with a time in status" trigger. I'm still figuring out how to get this (SLA?) tigger to work. To be continued ;-)


author: Alexander Pappert
body: on issue creation, the custom field is not filled/existing. thats why ist doesn't work there

comments: author: Ron Koudijs
body: So it is impossible to automate based upon custom fields? Strange! What is the work around? Can I automate / create a trigger "just after creation"?


author: Alexander Pappert
body: maybe this one helps

<https://community.atlassian.com/t5/Jira-Core-Server-questions/Set-summary-automatically-when-creating-a-issue/qaq-p/1433522>


author: Alexander Pappert
body: or, as [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) wrote

action: re-fetch issue


Tags: json
Automation rule - create issue if issue with the same summary doesn't exist
Asked by Ana MINCA:

Hello,

I have the following process that I would like to cover via an automation rule:

* Every day the team needs to do some checks in production (each time the same ones)
* In order to make sure they do not forget this step and we also have stats regarding the checks I would like to create an automation rule that each day, at the same time automatically creates a ticket in their Kanban board that contains the exact same information

Until here I have no issues, I managed to create the rule and the rule is triggered everyday at the specified time with the exact same template.

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

* As an additional layer, I want to check if the created ticket from the day before is in any other status then "Done", and if it is I want to not create the one scheduled for the current day (ex: If today is Tuesday and I still have in progress the ticket from Monday the rule should not create a new one)

Do you have any suggestions about how I can achieve this?

Thank you !


Answers:
author: Gareth Cantrell
body: [@Ana MINCA](/t5/user/viewprofilepage/user-id/3835124)

You can insert a *JQL Condition* immediately before the *Create new story* action, and use a query similar to the following:

```
type = Story AND summary ~ "Summary of created issue" AND resolution = Unresolved
```


author: Ana MINCA
body: Thank you for the answer. :) It works !


author: Alex Koxaras _Relational_
body: Hi [@Ana MINCA](/t5/user/viewprofilepage/user-id/3835124)

I would insert a JQL check prior of the action for creating the issue, just like the following image (don't mind the "Manual" trigger):

![myrule.png](https://community.atlassian.com/t5/image/serverpage/image-id/153790i98B0B6D20681D699/image-dimensions/468x149?v=v2 "myrule.png")

The JQL statement is this:

```
summary ~ "My Summary" AND status != Done AND (created >= startofday(-1) AND created < endofday(-1))
```

I would change the "My Summary" wording with the summary you give when creating the ticket.

Let me know if that worked.  
Alex
Regex is duplicating parts of a URL
Asked by Patrick Haley:

Hey everyone,

I'm trying to create an automation that when a link to an external Jira issue is added to the comments, it pastes the link into a custom *External URL*field. I'm new to regex so to test it I'm just having Jira bot return a comment with the URL.

When I add the URL into a comment as a hyperlink, Jira bot returns the URL back twice. However, If I paste a non-hyperlinked URL into the comments, it works correctly.

![2021-07-29_13-41-09.png](https://community.atlassian.com/t5/image/serverpage/image-id/153636iEDF343E0D8781361/image-size/large?v=v2&px=999 "2021-07-29_13-41-09.png")

I'm not exactly sure what I'm missing when I try to insert {{issue.comment.last.body.match("(https:\\/\\/jira.test.com\\/browse\\/ABC-\\d+)")}} into the comment.

![2021-07-29_13-46-46.png](https://community.atlassian.com/t5/image/serverpage/image-id/153638i5B0EA35BE90D629D/image-size/large?v=v2&px=999 "2021-07-29_13-46-46.png")

Any help is greatly appreciated.


Answers:
author: Bill Sheboy
body: Hi [@Patrick Haley](/t5/user/viewprofilepage/user-id/2887686)

If you were to export that issue with the comment and look at the body, I expect you will see it includes something like this

```
[https://jira.test.com/browse/ABC-135|https://jira.test.com/browse/ABC-135|smart-link]
```

So the URL is in there twice and so needs to be parsed accordingly, such as using the Match to make it a list, and then returning only one entry.

Best regards,  
Bill

comments: author: Patrick Haley
body: How do you make a list from the match and then return just that value?


author: Bill Sheboy
body: I can think of two ways to accomplish your goal:

* no list: Modify the regex to account for that pipe symbol (so you only get one URL), and then strip off the extraneous characters with the [replaceAll](https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/#Smartvaluestextfields-replaceAll-Stringregex-Stringreplacement-) function
* with list, and easier: Please note in your comment how [Match](https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/#Smartvaluestextfields-match--) added a comma between the values, so it should already be a list. You can just grab one by adding [.first](https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/#Smartvalueslists-list.first) after your Match call.


Tags: regex
Accessing all options when creating an issue
Asked by Chris Kwan:

Hi,

I'm trying to connect to the Jira API and retrieve all options for a custom field. From my research I will have to use "Get Create Issue Data" to retrieve this information. For context, I believe the company server is using the Rest API v2.

So I am trying to follow the instructions outlined here

<https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-get>

I can retrieve all options for every project type with

"/rest/api/2/issue/createmeta/"

But when I try to filter to only retrieve options for a specific project id with

"/rest/api/2/issue/createmeta/projectIds=16103"

It returns 404. I found the project id using inspect element and grabbing "value":"1603" that comes just after my desired project name.

Just wondering what I am doing wrong, this is my first time using the API, so I'm a little confused.

Thank you!


Answers:
author: David Bakkers
body: Hello [@Chris Kwan](/t5/user/viewprofilepage/user-id/4496102)

The projectIds is a parameter, and parameters are declared after the question mark, like this:
> /rest/api/2/issue/createmeta?projectIds=16103

Next, you said *"I believe the company **server** is using the Rest API v2"* but the link in your post points to documentation for Jira CLOUD's v2 REST API documentation and you've added the tag 'cloud' to your question. You need to find out if you are using Jira Server or Jira Cloud as the REST APIs of the two can be quite different.

If your company is on Jira Cloud, you should think about using the [v3 REST API](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/), as development of v2 ended some time ago.

If your company is on Jira Server, there is no v3 REST API, only a v2 REST API and the documentation [is here](https://docs.atlassian.com/software/jira/docs/api/REST/8.14.0/) (this is for server v8.14.0, which is the most recent)


Tags: cloud

rest-api
Popup when hovering mouse over text
Asked by Akakiy Zilbirshtein:

Hello!

Is it possible to show popup when hovering mouse over text? Which macros can help with this?


Answers:
author: Jack Brickey
body: [@Akakiy Zilbirshtein](/t5/user/viewprofilepage/user-id/4465130) , welcome to the Community. Is your question about Automation or Confluence or something else? The reason I ask is the the post is in the automation collection but has a Confluence tag.

in any event, I do not know of any options to provide for text pop ups in Confluence or Jira.


Tags: confluence

pop-up

text
User language as smart value
Asked by Martin Boehme:

Hi,

I want to send an e-mail to the reporter of a Jira SM ticket by using the "Send E-Mail" action of Automation for Jira.

If the user selected **German** as their preferred language in their profile settings, the text in the e-mail should be in **German** . If the user selected **any other language** , the text should be in **English**.

I would implement this by having a simple If-Else-Block that checks for a smart value / variable that contains the reporter's language.

I need to implement this for Cloud as well as for Data Center.

For **Cloud**, it should be fairly easy because the language the reporter used when creating the ticket is stored in the dedicated "Request language" field. ?

But in **Data Center**, this field does not exist (at least not until Jira SM 4.18). And I can't find any smart value that contains the user's language setting. ?

Does any one have a solution for this?

Best,

Martin


Answers:
author: Neenu jose
body: Any feasibility to implement it in Server/data center?


author: Martin LALONDE
body: I ran into the same problem trying to use smart value with an automation in Jira Cloud. I've tried many combination of the below smart value

{{issue.request language}}

{{issue.request language.name}}

{{issue.request language.value}}

{{customfield_xxxx}}

{{issue.Request Type.request language}}

{{issue.Request Type.request language.name}}

{{issue.Request Type.request language.value}}

Then to compare those, I've use either en or English and always came back false.

I've change my validation with a JQL request and this is working perfectly

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

I hope this could help others since this request is old.

comments: author: Pepijn Szek?r _GIM_
body: {{issue.request language.displayName}}


Tags: cloud

custom-field

data-center

jira-service-management

language

smart-value
Updating DueDate based on description
Asked by JZ:

Hi, I'm looking to have due dates for tickets automatically set based on a text string in the tickets description. does anyone know if this is possible or how to do that?


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

Yes, that should be possible with Automation for Jira (A4J). You do not indicate if you are using the Cloud or Server/Data Center version of Jira. For Cloud, A4J is built-in. For Server/Data Center, there is a free (Lite) or a paid (Pro) version of A4J.

Please look here for some information to get you started:

* <https://www.atlassian.com/software/jira/guides/expand-jira/automation>
* <https://community.atlassian.com/t5/Automation-articles/Jira-Automation-all-the-resources-you-need-in-one-page/ba-p/1388465>
* <https://www.atlassian.com/software/jira/automation-template-library#/label/all/1453>

Best regards,  
Bill
Is there a way to modify users' email address with SIL?
Asked by Bernd Lockermann:

Can't find a method for achieving this.

Maybe there are alternatives for an automated bulk change of the domain part of the email addresses? The instance is on-premise, version is v8.13.4


Answers:
author: JimmyVanAU
body: Hi Bernd,

Thanks for clarifying that they're all internal users. As such, if you have access to the database, you can follow this helpful KB article:

<https://confluence.atlassian.com/jirakb/how-to-change-all-jira-internal-users-e-mail-domain-name-in-bulk-720635217.html>

As always, test in a non-production environment, and take a database backup.

Cheers, Jimmy


author: Nic Brough -Adaptavist-
body: Are the accounts all internal accounts? Or are they external, from LDAP or some other directory?

comments: author: Bernd Lockermann
body: They are all internal accounts.


author: Nic Brough -Adaptavist-
body: Ok, I ask because SIL can only act on stuff that's editable inside Jira.

However, I don't think SIL can do it, as it's only really got issue handling functions. I've not seen it used outside working with issues.


author: Paul Gillis
body: Hi Nic. Could SIL be used to edit the email address of an inactive LDAP user account?

Our on-prem data center uses an SSO add-on and users login to SSO with their email address. I have a user who left our company, returned and has been assigned a different user ID but the same email address. When this person tries to login to Jira, it wants to use his old inactive account.


author: Bernd Lockermann
body: Hi Jimmy, hi Nic

Thank you for your answers! This will cut my search short.

If this is the most reasonable way to go then so it is.


Tags: power-scripts
How can I trigger an event, if an issue is not updated for a given time?
Asked by Martin Hechinger:

The motivation is that we have some people to remaind to there work issues after a couple days. We wish that the stories get closed or commented by the assignee. If not I want to remaind them via email notifications.

Therefore I wanted to check after 5 days, if the issue is updated in the last 5 days with the field updatedDate. But I was running into the issue, that this date is always updated, if the story is moved from the passt sprint into the next sprint, when we start the new sprint. So the story always looks like updated by somebody.

I was also thinking to catch somehow the last written comment of the stories to see, if they are older then 5 days. Does somebody know how to do that?

Thanks.


Answers:
author: Iago Docando
body: create an automation that triggers every day at before work starts and checks if the date of the last comment (or the las comment made by the assignee) is older than 5 days (and the issue is still open, of course).

Relevant smartvalues

* `{{comment.last.author}}` - Returns the ID of last comment's author.
* `{{comment.last.created}}` - Returns the date and time of the last comment.
* `{{`issue.assignee`}}` - You can probably guess it ;)

Then, as the action of the rule, send an email to each assignee.

I hope it helps :)

comments: author: Martin Hechinger
body: Yes lago Docando,

thanks alot, this seams to me a solution. I just have to figure out how I tread the case, if a issue does not have any comments. :-)

Cheers


author: Martin Hechinger
body: Ok, that with the empty comment was easy. But if I have the following else block, it send an email, even that the last comment is just 5 days old, but it shouldn't. ??

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


author: Martin Hechinger
body: I could solve it now with a JQL query:

issueFunction in lastComment ("before -7d")

Still don't know way the other way does not work.


author: Iago Docando
body: maybe the syntax wasn't quite right? I couldn't tell you from the top of my head really. The good thing is that you got it going. Congrats :)


Tags: cloud
Can you copy values from multi select user field to another field?
Asked by Linette George:

When the status changes, I want to copy the value of a user field to the assignee field. This works if the user field is single select. However, it doesn't work if its multi select. Anyone else seen this before? Is there a work around?


Answers:
author: Nic Brough -Adaptavist-
body: That's correct, the assignee field is single user, trying to copy a multi-select into it is nonsense, the data structure isn't supported.

You'll need to use single-user fields, or do a bit of coding to decide upon and extract the account you want to assign the issue to from the multi-select data.

comments: author: Linette George
body: Makes sense, thanks!


author: Sreenath
body: Hello, I have single select user field and when the transition the issue then I want to copy the field value and update in assignee field? Please help me how to achieve through JIRA cloud automation.


author: Curt Holley
body: [@Linette George](/t5/user/viewprofilepage/user-id/4428323)

If you are on Jira Cloud using the built in Automation for Jira (which I'm guessing you are?) then this might be helpful.

[Use smart values to access listed values \| Jira Software Cloud \| Atlassian Support](https://support.atlassian.com/jira-software-cloud/docs/use-smart-values-to-access-listed-values/)
restoring deleted repo
Asked by kostiag:

Hi, tbh I have no idea what happened, but seems that the repo has been deleted. It coincided with a laptop wipe so there is no latest version of the code anywhere. Is it possible to restore the repo from backups (it is my understanding that some backups do exist)?


Answers:
author: Syahrul
body: G'day, [@kostiag](/t5/user/viewprofilepage/user-id/2931719)

Could you please explain how you concluded that the repository has been deleted? Are you encountering any specific errors on your end, and if so, could you please share the details with me?

After reviewing your account, I couldn't identify any recently deleted repositories. Have you attempted to access the repository directly from the user interface?

Let me know how it goes.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
Trigger automation based of reporters domain
Asked by Patrick Halaseh:

Hi,

I am setting up a public widget for clients to contact us for support however we will require them to put in their email address in a field and we will use the domain of that email to trigger an alert in Slack and assign to an agent who specifically deals with this client.

I couldn't find a trigger that has something like:

User: Reporter

Check to perform: 'contains'

Value: '@emaildomain.com'

Anyone have an idea how to best set up an automation for this?

Here is what I can currently see and it will only give me a list of users already in our system.![no contains.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/151620i0888D6AF2E6AD02D/image-size/large?v=v2&px=999 "no contains.PNG")


Answers:
author: Joy Chiu
body: Hi [@Patrick Halaseh](/t5/user/viewprofilepage/user-id/4468011) ,

You can use this "advanced compare condition" to achieve it.

![Screen Shot 2021-07-16 at 11.32.49 am.png](https://community.atlassian.com/t5/image/serverpage/image-id/151621i415D354E94CB4657/image-size/large?v=v2&px=999 "Screen Shot 2021-07-16 at 11.32.49 am.png")

comments: author: Patrick Halaseh
body: Amazing thank you so much!


author: Tyler Stephens
body: Thank you!


author: Cleber Menezes
body: Hi all,

In this case, can I put at the same automation many domains?  
I have the same problem, but I need to configure this automation for 100 domains to edit a field value.

Can you help me in this case?

Tks
Failing to setup Pipeline creation via pipeline_config api
Asked by Pallav Kumar:

I am trying to automate pipeline creation for a given repo via api :

<https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines_config>

but even though I am getting success response, I not seeing bitbucket-pipeline.yml file getting created for my repo.

Is there anything I am missing or my understanding of this api is wrong ?


Answers:
author: Theodora Boudale
body: Hi [@Pallav Kumar](/t5/user/viewprofilepage/user-id/370525),

If you use this API call with data

```
{
  "enabled": true
}
```

you can enable Pipelines for the repository. However, the API call is not going to create a bitbucket-pipeline.yml file.

If you have a bitbucket-pipeline.yml file that you want to upload to a repo after you enable Pipelines, you can use the following API endpoint:

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-post>

This API endpoint will create a commit to the repo by uploading a certain file.

Please feel free to reach out if you have any questions!

Kind regards,  
Theodora

comments: author: Pallav Kumar
body: Thanks [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) . I will check and come back if needed.


author: Theodora Boudale
body: You are very welcome! Please feel free to let me know if you need any further help on this.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
git clone with OATH on BB Data Center
Asked by Blake Duffey:

Bitbucket is integrated with Azure AD for OAUTH SSO.

Trying to get git client (using tortoisegit) to clone a repo

I get the prompt 'sign in with your browser' (attached)

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

as soon as I click that option, I get this error:

**fatal: Bitbucket DC OAuth Client ID must be defined**


Answers:
author: Sascha Masanneck
body: Hi Blake. A similar issue seems to be affecting one of our users as well. Did you identify a solution we can implement?

comments: author: Blake Duffey
body: Not with password. We have users create an HTTP access token and assign permissions in BB - then when they get the prompt above they provide username and token (vs password.


author: P Satish Patro
body: Now also they need to give everytime access token? Or, after submitting once it doesn't ask anymore?  
I tried with 'sign with browser' that line is not coming but still it shows popup everytime. If I select 'password/token', then also it asks everytime. But, only this line is not there in the git log

<https://community.atlassian.com/t5/Sourcetree-articles/Bug-Fix-Sourcetree-for-Windows-authentication-error-when/bc-p/2720785#M194>


Tags: bitbucket-data-center

bitbucket-server

data-center

server