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 #4

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

FUS-5906 #4

wants to merge 25 commits into from

Conversation

DavidDwyer87
Copy link
Collaborator

https://lucidworks.atlassian.net/browse/FUS-5906

  • updates to jira asciidoc
  • add attachment support the configuration

jira/jira-v1.json Outdated Show resolved Hide resolved
jira/jira-v1.json Show resolved Hide resolved
jira/jira-v1.asciidoc Show resolved Hide resolved
jira/jira-v1.asciidoc Show resolved Hide resolved
jira/jira-v1.asciidoc Outdated Show resolved Hide resolved

* `${LW_BATCH_SIZE}` - 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`.

* `${LW_INDEX_START}` - This variable is used to set the `start` query parameter, which is used to traverse the pagination. Jira pagination is zero-index-based. This means the first page number is 0.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to: Add 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.

jira/jira-v1.asciidoc Outdated Show resolved Hide resolved

== Pagination information

This recipe is configured to use pagination by batch size.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
  1. 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 []

"childResponseMapping": {
"childDataId": "self",
"binaryResponse": true,
"parentNestedData": "issues[*].fields.attachment[*]",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change to `"parentNestedData": "fields.attachment[*]", otherwise the attachment metadata list will not be extracted

jira/jira-v1.json Show resolved Hide resolved
jira/jira-v1.asciidoc Show resolved Hide resolved
jira/jira-v1.asciidoc Outdated Show resolved Hide resolved
jira/jira-v1.asciidoc Outdated Show resolved Hide resolved
jira/jira-v1.asciidoc Show resolved Hide resolved
jira/jira-v1.asciidoc Show resolved Hide resolved
jira/jira-v1.asciidoc Show resolved Hide resolved
|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
|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[*]`
Copy link
Collaborator

@mcondo mcondo Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidDwyer87 I suggest to change description to: Download the attachment content. The request requires the 'attachment Id'. Internally, the plugin replaces the variable ${LW_PARENT_DATA_KEY} with the 'attachment id', which value is extracted in two steps: step-1) setting prop parentNestedDataPath= fields.attachment[*] to extract the attachment metadata list from the issue object step-2) setting prop parentDataKey=id to extract the 'id' from each attachment metadata. The download request will be performed per each attachment metadata found

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidDwyer87 this explanation is to describe how the /rest/api/2/attachment/content/${LW_PARENT_DATA_KEY} will download the attachments

jira/jira-v1.asciidoc Show resolved Hide resolved
jira/jira-v1.json Show resolved Hide resolved

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`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidDwyer87 this description is referencing confluence stuff (limit, blogspost, pages). Update to reference to Jira ->

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


* `${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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not describing the variable correctly, it should be ->

Used with Child Request Configuration. This variable is replaced with the 'id' extracted from root object, by setting the property parentDataKey. The jira use case indicates this variable can be added the URL to execute a GET request to retrieve comments, worklogs and attachments from issues

|=======================
|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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidDwyer87 description for Project Root Request is missing

@@ -0,0 +1,114 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there are two json files jira/jira-v1.json and sample-jira-setup.json? the second one does not configure the projects endpoint

]
},
"rootResponseMapping": {
"dataId": "self",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidDwyer87 I saw the dataId for project was updated to use key, maybe that should be made the same for issues?, also use key here instead of self?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants