Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Insight - how to apply Regular Expression for manipulating the value for the import source?

Sanja Vukovic February 15, 2018

In documentation https://documentation.riada.se/insight/latest/insight-manager-s-guide/import-and-synchronization/general-import-concepts under Import Attribute there is "concept" Regular Expression. What is "concept"? Where is the field inside import where I can enter regular expression?
It says "You can use regular expressions to edit the value from the import source." and goes on with examples and all. But it doesn't say where.

Please help.

1 answer

0 votes
Alexander Sundström
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.
February 15, 2018

Hi Sanja,

Look at the attached screenshots, click on the cogwheel to open the configure, and there you have the regular expression :)

Screen Shot 2018-02-16 at 08.46.38.pngScreen Shot 2018-02-16 at 08.46.48.png

Sanja Vukovic February 16, 2018

OK. (It would be nice if that detail was mentioned in documentation.)

I added custom attribute and I used Regular expression (\w*)\W and it works.
But when I look configuration, it is nowhere to be seen that I used it

Now I only need information what to put into Regular expression to get text, for exampe "HMC scan".

Alexander Sundström
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.
February 19, 2018

Hi Sanja,

What do you mean with 

 it is nowhere to be seen that I used it

Regarding using regular espressions we recommend the documentation at https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html for more information on how to build the regex, and personally, I try to use https://regexr.com/ when I want to test the result.

Best Regards
Alexander

Sanja Vukovic February 19, 2018

Hi Alexander,

Sorry, by "nowhere" I mean the input configuration. With or without regular expression, it looks the same. It should be visible whether a regular expression is used or not on that attribute.

I am trying to find the function that returns text string (constant), but I can't find it. Please help


Alexander Sundström
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.
February 19, 2018

If you investigate the insight_import.log that's in the JIRA Home directory, you'll see that regex has been applied. 

It's not possible to use regex to replace with a default value, regex can only alter the value that you inputed. As such, you would have to use automation rules to add a default value, like mentioned in another community question.

Best Regards
Alexander

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events