Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Split() - Split will result in an empty character.

恩田翔 August 13, 2024

Sorry if this is hard tounderstand as it it a machine translation.

I am in the process of creating a process to split the value of a custom field in an automated process and store it in a variable.

*Use smart values.

Trying it out in the "comments to the issue" section, Get the value of the custom field, The result of the split is empty.

Is there an incorrect way to specify the smart value?

 

In addition, the following is what is specified in the custom fields and smart values.

【Custom fields】

Type: single picker

Content:開発_サーバ#1:dp0vmpx201

【AutomationProcess】

Smart value:{{issue.開発環境ホスト名.split(":").second}}

 

{{issue.開発環境ホスト名}},it will be displayed without any problem.

1 answer

1 accepted

0 votes
Answer accepted
Kevin Patterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2024

Hi @恩田翔 ,

If I understand your needs correctly you have a text string in a custom field that will contain the character : and you would like to extract the second value dp0vmpx201. If this is correct I believe your issue is with the .second you are using in the split function. see below for what you can use to retrieve either side of the string from your custom field.

{{issue.開発環境ホスト名.split(":").get(0)}} should return 開発_サーバ#1
{{issue.開発環境ホスト名.split(":").get(1)}} should return dp0vmpx201

Let us know if this works, if not someone else might have an alternate approach that could work.

恩田翔 August 13, 2024

Thanks @Kevin Patterson 

I ran the "Add a comment to the issue" with the smart value you provided.

smart value:{{issue.開発環境ホスト名.split(":").get(1)}}

The result was still the same: empty text.

I am also using if conditions, etc. in an automated flow.

Does the composition of the flow, etc. have an effect on this?

Kevin Patterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 15, 2024

Hi @恩田翔 , if the action setting the smart value is done inside the if conditions and those conditions are not met then this could have an impact. For testing i'd recommend creating a separate automation rule that has a manual trigger and only has the smart value and add comment actions. Once you get this working you can validate that the {{issue.開発環境ホスト名.split(":").get(1)}} extracts the correct value and the move on to troubleshooting your other automation rule.  I've tested this in one of my instances and it looks to be working as expected. for my testing I added your text string to description and configured my smartvalue to pull out the value to the right of the : in the string.

automation rule:

automation.png

Issue with automation rule populating comment:

issue.png

恩田翔 August 21, 2024

hi, @Kevin Patterson 

In this case, the custom field for which the desired processing was to be performed had a single picker selected as the type.

In that case, it seemed to have the data internally in an array, so I gave it a “.value” as follows, and it worked.

{{issue.開発環境ホスト名.value.split(":").get(1)}}

Thanks for taking the time to discuss this with me.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events