The steps below underline how to create Issues from Document Objects, and automatically populate document object metadata into issue form questions.
TABLE OF CONTENTS
Set up auto-population
- In the Forms page create a new Issue Form. Create questions for all the fields you would like to auto populate.
- Create a new event in the Events page
- Add an event trigger to the event
- For the Trigger type, select “On Issue Create”.
- For the Form , select your issue form
- Add an event action to the event
- For the action type select “Answer Question”
- For the Form Name select your Issue Form
- For the Question, select the Issue Form question you’d like to auto-answer
- For the Owner, enter the User ID on behalf of whom the question will be answered. (You can enter “1” for “System”)
- In the Answer field, use one of the expressions below to extract fields from the document object content
- Repeat step #4 for all Issue Form questions you would like to auto-answer
Create an issue from the Document Object
- In the File view, click Process > Import Document Objects. You may need to edit your Layout and add the Document Objects panel to your layout
- Select a Document Object in the Document Objects panel. Click on the “⁞” icon and select “Create Issue From Document Object”
- Under Issue Form select the issue form you created
- Optionally, select a Status to propagate to the issue
- Click Create Issue
- The issue form answers will auto-populate momentarily.
Expressions
Below are expressions which can be used to extract specific fields from document objects using regular expressions (regex).
Please note that these expressions may differ depending on your document object format.
Type | (( #expr.getAllMatches(#issue.getSystemAttributeValue("relatedMarkupsInfo"), '(?<=\"title\":\")[^\\"]*' ) )) |
Name | (( #expr.getAllMatches(#issue.getSystemAttributeValue("relatedMarkupsInfo"), '<p><span.*>(.*)\(\s(.*)\s\)<\/span><\/p>', 1).get(0).trim() )) |
ID | (( #expr.getAllMatches(#issue.getSystemAttributeValue("relatedMarkupsInfo"), '<p><span.*>(.*)\(\s(.*)\s\)<\/span><\/p>', 2).get(0).trim() )) |
Variant | (( #expr.extractDocumentObjectFields(#issue.getSystemAttributeValue("relatedMarkupsInfo")).get("Variant" ) )) |
Status | (( #expr.extractDocumentObjectFields(#issue.getSystemAttributeValue("relatedMarkupsInfo")).get("Status" ) )) |
URL | (( #expr.extractDocumentObjectFields(#issue.getSystemAttributeValue("relatedMarkupsInfo")).get("URL" ) )) |
Note that this expression used above for Status and URL is reusable for any key-value pairs in the body of the document object which are separated by a colon. Just replace the key, (in this case URL or Status) with whichever key you are interested in.
Examples
Example issue form:
Example Event:
Example event action:
(answer an issue question with the Document Object “type” for example, “Message”)