Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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

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

 Getting all your own One-Time Rule (GET)

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

 Create a new One-Time Rule (POST)

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

 Edit an existing One-Time Rule (PUT)

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

 Delete an existing One-Time Rule (DELETE)

Method

DELETE

URL

/rest/ooo/1.0/onetimerule

Parameters

Required the following field

{
    "oneTimeId": "2"
}

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

 Get all Rule configured by adminstrator

Method

GET

URL

/rest/ooo/1.0/onetimerule/admin

Data

[
  {
    "projectIdString": "2",
    "covererId": "1000232",
    "covererAvatar": "",
    "covererDisplayName": "ABCDE",
    "projectInfo": "All other projects",
    "reassignMode": "coverer",
    "oneTimeMessage": "abcde is OOO",
    "startDateString": "2018-09-14 12:00",
    "endDateString": "2018-09-20 12:00"
    "oneTimeId": 2,
    "byAdmin": true,
    "byTeam": false,
    "creatorAvatar": "",
    "creatorDisplayName": "Administrator",
    "assigneeId": "1000222",
    "assigneeAvatar": "",
    "assigneeDisplayName": "FGHIJ",
    "sdInternalComment": false,
    "doNotRespondToPublic": false
  }
]

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. 

  • No labels