Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FUS-5906: Provide Jira Recipe and documentation #4

Merged
merged 37 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5a45d55
update to the datasoruce config template
DavidDwyer87 Nov 12, 2024
95c6385
add attachment and change pipeline
DavidDwyer87 Nov 13, 2024
9999888
doc update
DavidDwyer87 Nov 13, 2024
19a0427
update endpoint description
DavidDwyer87 Nov 13, 2024
8a4b7d0
add issues to the list of capabilities
DavidDwyer87 Nov 14, 2024
5bcee3c
password instruction
DavidDwyer87 Nov 18, 2024
4e4b20b
grammer correction
DavidDwyer87 Nov 18, 2024
b146d58
updates to pagination
DavidDwyer87 Nov 18, 2024
0d559a9
value correction
DavidDwyer87 Nov 18, 2024
d9f44b1
add a pipeline note
DavidDwyer87 Nov 18, 2024
841aab9
correction to rest config
DavidDwyer87 Nov 18, 2024
e812e02
re-arrange table
DavidDwyer87 Nov 18, 2024
875decc
update term description
DavidDwyer87 Nov 18, 2024
6a68567
add example of jasonpath
DavidDwyer87 Nov 18, 2024
fdf1923
updated to child request
DavidDwyer87 Nov 18, 2024
b2e751c
update root request description
DavidDwyer87 Nov 18, 2024
6461cf5
worklogs update description
DavidDwyer87 Nov 18, 2024
0b4bbce
comments description update
DavidDwyer87 Nov 18, 2024
c3c7f77
update root request description
DavidDwyer87 Nov 18, 2024
d443453
indexing project as solr docs
DavidDwyer87 Nov 18, 2024
486c944
correct formatting issue
DavidDwyer87 Nov 19, 2024
fc48d41
update varialbe description
DavidDwyer87 Nov 19, 2024
f7b37d7
update variables
DavidDwyer87 Nov 19, 2024
b4ea49c
correction to formatting
DavidDwyer87 Nov 19, 2024
fbc3ba9
Parent nested data path
DavidDwyer87 Nov 19, 2024
690d0a4
update download description
DavidDwyer87 Nov 20, 2024
0f1d15a
remove conflience ref
DavidDwyer87 Nov 20, 2024
b649ddd
fix parent
DavidDwyer87 Nov 20, 2024
ec5e092
change the dataid from self to key for jira issues
DavidDwyer87 Nov 20, 2024
21c49dc
remove sample
DavidDwyer87 Nov 20, 2024
b6e132c
add the jira project root requests
DavidDwyer87 Nov 20, 2024
ae9e83c
remove more confluence references
DavidDwyer87 Nov 20, 2024
e0de6d8
improve description
DavidDwyer87 Nov 20, 2024
3bfd337
fix doc formatting
DavidDwyer87 Nov 20, 2024
d4d12ae
FUS-5906: Update asciidoc
mcondo Nov 20, 2024
89eb984
FUS-5906: Update asciidoc
mcondo Nov 20, 2024
b845217
FUS-5906: Update asciidoc
mcondo Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions confluence/confluence-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "confluence",
"type": "lucidworks.rest",
"properties": {
"serviceURL": "https://{add confluence instance}",
"serviceURL": "https://{add confluence url}",
"authenticationMode": {
"basicAuth": {
"password": "xXx-Redacted-xXx",
Expand Down Expand Up @@ -63,8 +63,8 @@
}
}
],
"collection": "{add collection here}"
"collection": "{add collection name here}"
},
"pipeline": "{add pipeline name}",
"pipeline": "{add pipeline name here}",
"connector": "lucidworks.rest"
}
105 changes: 105 additions & 0 deletions jira/jira-v1.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
== Jira REST Configuration

This documentation describes aspects of the Jira REST `jira-v1.json` file configuration such as the authentication methods, data crawled and retrieved, pagination information, variables used, and endpoints used. Terminology is also provided as a reference.

The list of data the REST connector crawls using the jira REST configuration is:

* Projects
* issues
* Comments
* Worklogs
* Attachments
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved


== Authentication methods

The Jira REST configuration supports:

* Basic Authentication using the username and password from an Atlassian account. For more information, see link:https://developer.atlassian.com/cloud/confluence/basic-auth-for-rest-apis/[Basic auth for REST APIs | Atlassian Developer^].
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
* API Token. For information about how to create a new API token, see link:https://id.atlassian.com/manage/api-tokens[API Tokens | Atlassian ID^].

N.B. The API token is a requirement to authenticate the at Atlassian api. Instead of using the Atlassian account password, Use the token value for the password.


== Supported crawl options

The Jira REST configuration supports the following crawl options:

* Full crawl

* Recrawl that rely on the strayContentDeletion feature from the connectors-service


== Pipeline

The default pipeline is set to `_system` but can changed to any pipeline base on index needs.
mcondo marked this conversation as resolved.
Show resolved Hide resolved

== Pagination information

This recipe is configured to use pagination by batch size. Needs to configure Query Params, and the property 'Pagination By BatchSize'
Query Params:

* maxResults=`${LW_BATCH_SIZE}`, where `${LW_BATCH_SIZE}` is a variable

* startAt=`${LW_INDEX_START}`, where `${LW_INDEX_START}` is a variable

Configure the 'Pagination By BatchSize' properties:

* IndexStart: The starting point. Set to 0 because the Atlassian pagination is zero-index-base. From the queries above, it replaces variable `${LW_INDEX_START}`, the plugin internally increases the value of the indexStart ensuring each page is requested with an updated start-point.
* BatchSize: The number of elements to retrieve. Set to 50 by default. From the queries above, it replaces variable `${LW_BATCH_SIZE}`
* Stop Condition Key: Reference the “key” in the response, that needs to be met in order to stop the pagination. To paginate issues, it must be “issues”, to paginate projects it must be 'values'
* Stop Condition Value: Reference the “value” in the response, that needs to be met in order to stop the pagination. For the jira config, to stop pagination the list of objects retrieved must be empty, then the stop condition should be []
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved


== Variables used

The Jira REST configuration variables used are:

* `${LW_BATCH_SIZE}` - Used with pagination feature. This variable is used to set the `limit` query parameter, which controls the number of results that are returned in the response for both `blogpost` and `pages`.
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved

* `${LW_INDEX_START}` - Used with pagination feature. This variable is used to set the startAt query parameter, which is used to traverse the pagination. Jira pagination is zero-index-based. This means the first page number is 0.

* `${LW_PARENT_DATA_KEY}` - Used with pagination feature. This variable is used to set the maxResults query parameter, which controls the number of results that are returned in the response for projects, issues, comments, worklogs
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved


== Endpoints to configure with the Jira REST connector

The following table describes the jira REST connector endpoints.

*Notes:*

The list of objects is retrieved in batches. Objects include spaces, pages, blogs, and comments. The default number of batch items retrieved is 25. You can configure the query limit to retrieve more objects. The maximum value to retrieve is 250.
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved


[options="header",cols="1m,1,1m,1,1"]
|=======================
|Request type|Endpoint|HTTP operation |Query parameter |Description

|Root Request |/rest/api/2/search|GET |fields=assignee,issuetype,priority,project,reporter,status,summary,updated,attachment&startAt=1&maxResults=50|Returns all jira issues. Each issue contains its list of attachments metadata
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
|Child Request |/rest/api/2/issue/`${LW_PARENT_DATA_KEY}`/comment|GET|startAt=0&maxResult=50| Returns all comments. The request requires the 'issue Id'. Internally, the plugin replaces the variable `${LW_PARENT_DATA_KEY}` with the 'issue id', which value is extracted from the 'issue object' (root object) by setting the parentDataKey property.
|Child Request |/rest/api/2/issue/`${LW_PARENT_DATA_KEY}`/worklog | GET |startAt=0&maxResult=50 | Returns all worklogs. The request requires the 'issue Id'. Internally, the plugin replaces the variable `${LW_PARENT_DATA_KEY}` with the 'issue id', which value is extracted from the 'issue object' (root object) by setting the parentDataKey property.
|Child Request |/rest/api/2/attachment/content/`${LW_PARENT_DATA_KEY}`|GET|-|Use root response containing attachment Id's to retrieve attachments. The following jsonpath is used to retrieve the attachment id's `fields.attachment[*]`
|=======================


== Terminology

The following terms are provided as a reference.

[options="header",cols="1s,1"]
|=======================

|Term|Description
|Service Endpoints|The list of service endpoints from which the data is retrieved. Each service endpoint configures a root endpoint request.
|Root Request|The type of request to retrieve a list of root data objects.
|Child Request|The type of request to retrieve additional information for the root data objects. The child requests will be performed per each root data object.
|Root Response Mapping|Defines the mapping between the response and data objects to be indexed.
|Child Response Mapping |Defines the mapping between the child response and child data objects to be indexed.
|Data Path|The path to access a specific data object within a response. For example, to access a list of elements named with key `objects`, the DataPath would be `objects`. If not provided, the entire response body will be indexed. This property accepts JsonPath expressions e.g.objects, objects[*] or $.objects[*]
mcondo marked this conversation as resolved.
Show resolved Hide resolved
|DATA ID|The identifier key for the data objects extracted with 'Data Path', this value will be used to build the solr-document's ID. If not provided, a random UUID will be used. This property accepts JsonPath expressions.
|Parent Data Key|Key to extract data from the root/parent response used in the subsequent request. The extracted value is used to replace the ${LW_PARENT_DATA_KEY} variable in the child request configuration (endpoint, query params or body). For example, endpoint: /api/path/${LW_PARENT_DATA_KEY}/additionalInfo.
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
|Parent Nested Data Path| The path to a nested object within the Parent Data. When this property is set, the 'Parent Data Key' should point to the 'id' or 'key' of the nested object. If the nested object is a List, this will be iterated to perform a request per each one.
|Child Data Path|The path to access a specific object within a child response. For example, to access a list of elements named with the key `objects`, the ChildDataPath would be `objects`. If not provided, the entire response body will be indexed.
|Child Data ID|The identifier key for the child data object, where the value is the solr-document's ID. Enter this when the `Custom Solr Field` is empty, otherwise the solr-document's ID will be a random universally unique identifier (UUID).
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
|Custom Solr Field|The field to use to store the child data within the root data objects. If not set, the child data object will be indexed as an individual solr-documents.
|=======================
161 changes: 161 additions & 0 deletions jira/jira-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"parserId": "_system",
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
"coreProperties": {},
"id": "rest-jira",
"type": "lucidworks.rest",
"properties": {
"serviceURL": "https://{add jira url}",
"authenticationMode": {
"basicAuth": {
"password": "xXx-Redacted-xXx",
"user": "add email address here!!!"
}
},
"serviceEndpoints": [
{
"childrenRequests": [
{
"dataRequest": {
"endpoint": "/rest/api/2/issue/${LW_PARENT_DATA_KEY}/comment",
"pagination": {
"paginationByBatchSize": {
"paginationStopConditionValue": "[]",
"paginationStopConditionKey": "comments",
"batchSize": 50,
"indexStart": 0
}
},
"httpMethod": "GET",
"queries": [
{
"queryKey": "startAt",
"queryValue": "${LW_INDEX_START}"
},
{
"queryKey": "maxResult",
"queryValue": "${LW_BATCH_SIZE}"
}
]
},
"childResponseMapping": {
"childDataId": "self",
"childDataPath": "comments",
"parentIdKey": "id"
}
},
{
"dataRequest": {
"endpoint": "/rest/api/2/issue/${LW_PARENT_DATA_KEY}/worklog",
"pagination": {
"paginationByBatchSize": {
"paginationStopConditionValue": "[]",
"paginationStopConditionKey": "worklogs",
"batchSize": 50,
"indexStart": 0
}
},
"httpMethod": "GET",
"queries": [
{
"queryKey": "startAt",
"queryValue": "${LW_INDEX_START}"
},
{
"queryKey": "maxResults",
"queryValue": "${LW_BATCH_SIZE}"
}
]
},
"childResponseMapping": {
"childDataId": "self",
"childDataPath": "worklogs",
"parentIdKey": "id"
}
},
{
"dataRequest": {
"endpoint": "/rest/api/2/attachment/content/${LW_PARENT_DATA_KEY}",
"httpMethod": "GET"
},
"childResponseMapping": {
"childDataId": "self",
"binaryResponse": true,
"parentNestedData": "fields.attachment[*]",
"parentIdKey": "id"
}
}
],
"rootRequest": {
"dataRequest": {
"endpoint": "/rest/api/2/search",
"pagination": {
"paginationByBatchSize": {
"paginationStopConditionValue": "[]",
"paginationStopConditionKey": "issues",
"batchSize": 50,
"indexStart": 0
}
},
"httpMethod": "GET",
"queries": [
{
"queryKey": "fields",
"queryValue": "assignee,issuetype,priority,project,reporter,status,summary,updated,attachment"
},
{
"queryKey": "startAt",
"queryValue": "${LW_INDEX_START}"
},
{
"queryKey": "maxResult",
"queryValue": "${LW_BATCH_SIZE}"
}
]
},
"rootResponseMapping": {
"dataId": "self",
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
"dataPath": "issues"
}
}
},
{
"rootRequest": {
"dataRequest": {
"endpoint": "/rest/api/2/project/search",
"pagination": {
"paginationByBatchSize": {
"paginationStopConditionValue": "[]",
"paginationStopConditionKey": "values",
"batchSize": 50,
"indexStart": 0
}
},
"httpMethod": "GET",
"queries": [
{
"queryKey": "expand",
"queryValue": "description,lead,issueTypes,url,projectKeys,permissions,insight"
},
{
"queryKey": "startAt",
"queryValue": "${LW_INDEX_START}"
},
{
"queryKey": "maxResults",
"queryValue": "${LW_BATCH_SIZE}"
}
]
},
"rootResponseMapping": {
"dataId": "key",
"binaryResponse": false,
"dataPath": "values"
}
}
}
],
DavidDwyer87 marked this conversation as resolved.
Show resolved Hide resolved
"collection": "{add collection name here}"
},
"pipeline": "{add pipeline name here}",
"connector": "lucidworks.rest"
}
Loading