Out of Office Assistant
Breadcrumbs

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

String

projectIdString

"-1"

"-1" will be all other project

If not, it will be the projectId of project

String

covererId


The coverer’s 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’s full name which is used to populate in one time rule table

String

standInId


The stand-in’s username if standInAction is set to “replace” or “add”

String

standInAvatar


The small avatar img of the stand-in which is used to populate in one time rule table

String

standInDisplayName


The stand-in’s full name which is used to populate in one time rule table

String

standInAction


Either

  • “replace”, which replaces the OOO user with their stand-in as an approver in the issue

  • “add”, which adds the stand-in as an approver to the issue

  • “nothing”, which does not make any changes to the approvers field

If “replace” or “add” is given, a standInId must be given as well.

String

projectAvatar


The small avatar img of the project the rule applies to, or blank if the rule applies to all other projects

String

projectName


The name of the project the rule applies to, or “All other projects”

String

projectKey


The key of the project the rule applies to, or blank if the rule applies to all other projects

String

reassignMode


Can use "reassign", for re-assigning issue

Can use "unassign", for unassigning issue ( https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/information.png 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

boolean

isSdProject

false

If the project involved in the rule is a service desk project, used to populate the one time rule table

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": "",
        "standInId": "alice",
        "standInAvatar": "http://192.168.9.150:8080/secure/useravatar?size=xsmall&avatarId=10340",
        "standInDisplayName": "Alice",
        "standInAction": "replace",
        "projectAvatar": "http://192.168.9.150:8080/secure/projectavatar?size=xsmall&avatarId=10324"
        "projectName": "Akeles",
        "projectKey": "AKELES"
        "reassignMode": "unassign",
        "oneTimeMessage": "I am OOO for today",
        "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": "",
        "isSdProject": false
    }
]

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. For standInAction, choose one of “replace”, “add”, or “nothing”. If “replace” or “add” is chosen, a standInId should also be provided.

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

Response

STATUS 200 https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/check.png

  • Successful creation of new one time rule

STATUS 401 https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/error.png

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

STATUS 406   https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/error.png

  • 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",
    "standInId": "alice",
    "standInAction": "replace",
    "startDateString": "2018-09-14 12:00",
    "endDateString": "2018-09-20 12:00"
}

Response

STATUS 200 https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/check.png

  • Successful editing of existing one time rule

STATUS 401 https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/error.png

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

STATUS 406   https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/error.png

  • 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 https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/check.png

  • Successful deleting of existing one time rule

STATUS 401 https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/error.png

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

STATUS 406   https://akeles.jira.com/wiki/s/-505230918/6452/267b0663176c4f8787189805bf0a33b7c6d3998e/_/images/icons/emoticons/error.png

  • 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",
    "standInId": "",
    "standInAvatar": "",
    "standInDisplayName": "",
    "standInAction": "nothing",
    "projectAvatar": "",
    "projectName": "All other projects",
    "projectKey": "",
    "reassignMode": "coverer",
    "oneTimeMessage": "abcde is OOO",
    "startDateString": "2018-09-14 12:00",
    "endDateString": "2018-09-20 12:00",
    "oneTimeId": 2,
    "oneTimeMessage": "I am OOO for today",
    "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.