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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Jira Structure SEARCH leaving parts of text.

Hiya Folks!

 

I can't for the lift of me get rid of a couple of letters that come from using SEARCH/REPLACE_TO "S]" (they are from the description field)  . I know this is a super confusing and strange way to do this. Any help would be amazing. Thank you in advance!

Context:

Searching the Description field for our build link, then using REPLACE_AT since where the link get posted moves a bit.

Next, I am searching for what comes just ask the link 100% of the time. "Server Build -" and also using REPLACE_TO since that one moves a bit due to the data generated.

Then, I use REPLACE on both REPLACE_AT's to join the field (this is done to remove everything after the link)

Finally I am CONCAT the above line with a custom name for the link.

 

Formula

with buildLink = SEARCH("/.https://buildserver.net/job/./", description,0):
With buildReplace = REPLACE_AT(description,0,buildLink):


with endLink = SEARCH("Server Build -"; description;0):
With endReplace = REPLACE_AT(description,0,endLink, ""):

with bothReplace = REPLACE (buildReplace, endReplace):

IF issuetype:

If(bothReplace,concat("[Build Link |";bothReplace;"]"))

 

Output (The bold is a URL and there is the "S]" that is still being pulled in from the description)

Build Link S]

1 answer

1 vote
Nicholas Ellis _ALM Works_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 10, 2023

Hi JL,

I have to say this is a bit of a confusing way to do this.  I would suggest redoing this with concat instead of replace at.  The second line replace_at is essentially just inserting text, meaning it should be equivalent to:

CONCAT( buildLink, description )

The next two lines are possibly not doing anything.  Search will return a number (undefined if it finds nothing).  That number is then inserted into the next line as the 3rd argument for repalce_at, which is the number of characters to replace.  if the "Server build -" String is found at character 41, then it inserts an empty string 41 times, which should do nothing.

Then the both replace line should be removing any parts of buildReplace that match EndReplace.  Also note endReplace is treated as a regex so any special characters may cause unexpected results.

The last two lines are the most straight forward and should probably remain.  If issuetype is a good way of excluding folders, and grouping that shouldn't have values anyways, and the other line basically concats the result of both replace with some formatting if it exists.

Overall I think you can simplify a lot of the top sections by simply using concat to add text.  Here is the documentation, which I hope helps point you in the right direction.   https://wiki.almworks.com/documentation/structure/latest/data-center-and-server/expr-function-reference-172164198.html#id-.ExprFunctionReferencev8.3-REPLACE_AT

Cheers,
Nick [Tempo/ALM Works]

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events