Document toolboxDocument toolbox

REST API - Configuring One Time Rule

Introduction

It is possible to update the configuring OOO one-time rule for the users via REST API

Configuring One-Time Rule.png

List of Attributes

Data Type

Attribute Name

Default Value

Remarks

Data Type

Attribute Name

Default Value

Remarks

String

projectIdString

"-1"

"-1" will be all other project

If not, it will be the projectId of project

String

covererId

 

The coverer username if reassignMode is set to "coverer"

Set to "-" for do not re-assign issue

String

covererAvatar

 

The small avatar img of coverer which is used to populate in one time rule table

String

covererDisplayName

 

The coverer full name which is used to populate in one time rule table

String

projectInfo

 

The project name and key which are configured

String

reassignMode

 

Can use "reassign", for re-assigning issue

Can use "unassign", for unassigning issue ( the option is only available if JIRA allow unassign issue)

Can use "same", for do not re-assign issue

String

oneTimeMessage

 

Message to be added into comment should the user is OOO

String

startDateString

 

String of the out of office start date format ("yyyy-MM-dd HH:mm")

String

endDateString

 

String of the out of office end date format ("yyyy-MM-dd HH:mm")

String

creatorAvatar

 

The small avatar img of rule creator which is used to populate in one time rule table

String

creatorDisplayName

 

The creator full name which is used to populate in one time rule table

String

assigneeId

 

The ooo user's username

String

assigneeAvatar

 

The ooo user's avatar

String

assigneeDisplayName

 

The ooo user's full name

int

oneTimeId

0

The id of the one time rule for update and delete rule

boolean

byAdmin

false

if the rule is configured by admin

boolean

byTeam

false

if the rule is configured by team

REST APIs

Method

GET

URL

/rest/ooo/1.0/onetimerule

Data

Return an array of OneTimeRule object
See above inner class section on data transaction

Example

[ { "projectIdString": "10001", "covererId": "", "covererAvatar": "", "covererDisplayName": "", "projectInfo": "Akeles [AKELES]", "reassignMode": "unassign", "startDateString": "2018-10-11 00:00", "endDateString": "2018-10-18 23:59", "oneTimeId": 5, "byAdmin": false, "byTeam": false, "creatorAvatar": "http://192.168.9.150:8080/secure/useravatar?size=xsmall&avatarId=10337", "creatorDisplayName": "John", "assigneeId": "", "assigneeAvatar": "", "assigneeDisplayName": "" } ]

Remarks

Does not allow you to search based on assigneeId. It will return all the one time rule configured for the current logged in user

 

Method

POST

URL

/rest/ooo/1.0/onetimerule

Parameters

Required the following field

{ "assigneeId": "1000222", "projectIdString": "2", "reassignMode": "unassign", "covererId": "", "startDateString": "2018-09-14 12:00", "endDateString": "2018-09-20 12:00" }

Response

STATUS 200

  • Successful creation of new one time rule

STATUS 401

  • UNAUTHORIZED - Not logged in or do not have administrator access

STATUS 406  

  • NOT_ACCEPTABLE - Error when validating data or invalid user

Remarks

Will perform validateUser() and validateOneTimeRule()

User - Check if user is admin if byAdmin is set to true
OneTimeRule - Check for data format and mandatory data required

 

Method

PUT

URL

/rest/ooo/1.0/onetimerule

Parameters

Required the following field

{ "oneTimeId": "2", "assigneeId": "1000222", "projectIdString": "2", "reassignMode": "coverer", "covererId": "1000232", "startDateString": "2018-09-14 12:00", "endDateString": "2018-09-20 12:00" }

Response

STATUS 200

  • Successful editing of existing one time rule

STATUS 401

  • UNAUTHORIZED - Not logged in or do not have administrator access

STATUS 406  

  • NOT_ACCEPTABLE - Error when validating data or invalid user

Remarks

Will perform validateUser() and validateOneTimeRule()

User - Check if user is admin if byAdmin is set to true
OneTimeRule - Check for data format and mandatory data required

 

Method

DELETE

URL

/rest/ooo/1.0/onetimerule

Parameters

Required the following field

Response

STATUS 200

  • Successful deleting of existing one time rule

STATUS 401

  • UNAUTHORIZED - Not logged in or do not have administrator access

STATUS 406  

  • NOT_ACCEPTABLE - Error when validating data or invalid user

Remarks

Will perform validateUser() and validateOneTimeRule()

User - Check if user is admin if byAdmin is set to true
OneTimeRule - Check for data format and mandatory data required

 

Method

GET

URL

/rest/ooo/1.0/onetimerule/admin

Data

Remarks

Return an array of OneTimeRule

See above inner class section on data transaction

Same as getting all of your own one time rule just that this is all rules created by admin.