Page tree
Skip to end of metadata
Go to start of metadata

By default all extracted text from images are appended to a custom field called ExtracText. You can choose to change this behavior or define new "Rules" per project.

You can get to the Rules page by going to the project admin screen and then selecting "ExtracText Rules" from the left menu. 


Disabling default behavior

On the rules page you can select the check box(enable it) in order to disable the default rule as shown below:


Once disabled extracted text from images are not appended to the custom field "ExtracText" and will not show up in search results. 

Creating new Rule

Click on the "New Rule" button to create a new Rule. You can choose one condition and one action per rule. 

The conditions available are:

  1. Image contains text like: This condition will be satisfied if the provided string is found in the extracted text from the image. It is case insensitive.
  2. File name contains text like: This condition will be satisfied if the provided string is found in the file name of the attachment.
  3. Image contains text matching regex: This condition will be satisfied if the image contains text matching the provided regular expression. You can use the complete set of regular expressions as supported by Java

The actions available are:

  1. Assign issue: This will assign the issue to the specified user.
  2. Set custom field value: This will set the value of the specified custom field. The value can be a fixed string or a string extracted from the image and matching the condition in regex matching group. Only single line or multi line text based custom fields are supported. Refer to "Groups and Capturing" as specified here. In order to use the captured groups follow the syntax {{{$variable-number}}} . For example, to refer to group 1 use {{{$1}}} and so on. 

Examples

In this example the issue will be assigned to user "finance" if the file name contains text like "expense".

2. 

In this example the issue will be assigned to "hr-dept" user if file name contains keyword "offer-letter".

3. 

Here if the image contains text like "ABCD" the issue will be assigned to "dev-team".

4.

Here if the image contains text like "for-review" the issue will be assigned to qa-team

5.

Here if the image matches the regex "first name (.*) \n" then the custom field named "First Name" will be updated with the value extracted specified within parentheses followed by a new line symbol. That is if there is a string in the image like 

first name: Tommy

Last name: Tom

,then "Tommy" will be extracted and the custom field First name will be updated with the value "Tommy". you can refer to field group variables using the syntax {{{$variable-number}}}. the first match will be $1 and so on.

6.

Here if the image contains text like "Employee id" then the custom field named Employee id will be updated with the value extracted specified within parentheses followed by new line symbol. That is if there is a string like

Employee id: 123456

Employee Dept:

, then 123456 will be extracted and the custom field Employee id will be set that value.

7.

This is a little complex rule for advanced users. To break it down:

Regex is: (?sim)Expense Report.*^Employee Name: (.*)^Department.*^Comments: (.*)Employee Signature

(?sim) stands for:

s - dot operator should include new line characters as well.

i - ignore case

m - ^ and $ symbol will be applied for every new line and end of line (multi line)

So the regex will make sure there will be a text called "Expense Report" and then extract out fields like "Employee Name" and "Comments" . For example if the image contains text like below:

Expense Report

Company XYZ

Employee Name: Tom Tom

Department: Sales

Amount: $100

Comments: team lunch

Employee Signature:

Date:

then Employee name and Comments extracted inside the two parentheses will be set to the appropriate fields using variables $1 and $2 specified inside three curly brackets as shown. 

Using regex you can create complex text retrieval rules and update fields as needed. 




  • No labels