This library helps in communication with Jira REST API by exposing API requests as straightforward tasks and Jira resources data into some opaque types.
Authentication credentials
createAnonymousCred : String -> Result String Cred
Create credentials for publicly open Jira (as an anonymous user)
createBasicAuthCred : String -> ( String, String ) -> Result String Cred
Create credentials using basic auth method
Jira Project
Jira Issue
Issue worklog entry
{ started : Time.Posix
, timeSpentSeconds : Basics.Int
, comment : Maybe Content
}
Structure used to add new worklog to an issue
{ id : String
, issueId : String
, created : Time.Posix
, started : Time.Posix
, updated : Time.Posix
, timeSpent : String
, timeSpentSeconds : Basics.Int
, author : Json.Decode.Value
, updateAuthor : Json.Decode.Value
}
Persisted worklog details
Content which is used across comments, descriptions etc
Task ApiCallError response
Jira API call task
getProjects : Cred -> Jira.Pagination.PageRequest -> ApiTask (Jira.Pagination.Page Project)
Get page of projects
getAllProjects : Cred -> ApiTask (List Project)
Get all projects
getIssues : Cred -> Jira.Pagination.PageRequest -> Jira.JqlInternal.Jql -> List String -> ApiTask (Jira.Pagination.Page Issue)
Search for issues using Jql with and scoping available fields per issue
getFullIssues : Cred -> Jira.Pagination.PageRequest -> Jira.JqlInternal.Jql -> ApiTask (Jira.Pagination.Page Issue)
Search for issues using Jql with all fields per issue
addWorklog : Cred -> Issue -> WorklogRequest -> ApiTask Worklog
Add worklog to an issue
addWorklog cred
issue
{ started = Posix.millisToPosix 1543173302785
, timeSpentSeconds = 3600
, comment = Just (contentFromString "Some comment")
}
addWorklogToIssueByKeyOrId : Cred -> String -> WorklogRequest -> ApiTask Worklog
Add worklog to an issue by it's key or id:
addWorklog cred
"EXA-1"
{ started = Time.millisToPosix 1543173302785
, timeSpentSeconds = 3600
, comment = Just (contentFromString "Some comment")
}
allFields : List String
Fields scope where all fields are requested
allFieldsExcept : List String -> List String
Fields scope where all fields except provided ones are requested
getProjectData : Project -> ProjectData
Extract raw data from Project
getIssueId : Issue -> String
Get issue id
getIssueKey : Issue -> String
Get issue key
getIssueFields : Issue -> Json.Decode.Value
Get issue fields. Note: as structure of available fields vary depending on requested fields configuration, you have to decode the fields that you are interested in.
getWorklogData : Worklog -> WorklogData
Get data from worklog
contentFromString : String -> Content
Create text content
Error from api call request task
apiErrorToString : ApiCallError -> String
Convert API call error to a simple string