Skip to content

Commit

Permalink
can try to find user
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Aug 8, 2024
1 parent 7bd0c00 commit 496f124
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/JiraPharoAPI/JiraPharoAPI.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ JiraPharoAPI >> configureReaderForJiraIssue: reader [
{ #category : #'api - issue search' }
JiraPharoAPI >> configureReaderForJiraUser: reader [

reader for: JPUser do: [ :mapping | mapping mapAllInstVars ]
reader for: JPUser do: [ :mapping | mapping mapAllInstVars ].
reader
for: #ArrayOfJPUser
customDo: [ :customMapping |
customMapping listOfElementSchema: JPUser ]
]

{ #category : #'api - issue search' }
Expand Down Expand Up @@ -213,6 +217,33 @@ JiraPharoAPI >> endpoint: anObject [
endpoint := anObject
]

{ #category : #'api - user' }
JiraPharoAPI >> findUserUsingQuery: aQuery [
"https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-rest-api-2-user-get"

^ self findUserUsingQuery: aQuery maxResults: nil startAt: nil
]

{ #category : #'api - user' }
JiraPharoAPI >> findUserUsingQuery: aQuery maxResults: maxResults startAt: startAt [
"https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-rest-api-2-user-get"

self prepareZnClient.
znClient path: self basePath , '/user/search'.
znClient queryAt: 'query' put: aQuery.


maxResults ifNotNil: [ :e | znClient queryAt: #maxResults put: e ].
startAt ifNotNil: [ :e | znClient queryAt: #startAt put: e ].

self rawData ifFalse: [
znClient contentReader: [ :entity |
generalReader
on: entity contents readStream;
nextAs: #ArrayOfJPUser ] ].
^ znClient get
]

{ #category : #accessing }
JiraPharoAPI >> generalReader [

Expand Down

0 comments on commit 496f124

Please sign in to comment.