Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Now it is possible for 3rd party apps to send out of office information or query out of office period with the newly added REST endpoints.

...

  • ConfigResource - Used for configuring options and JQL Filter. 
  • OutOfOfficeOneTimeRuleResource - Used for configuring any one time rule.
  • OutOfOfficePeriodResource - Used for configuring OutOfOffice Period.
  • OutOfOfficeRecurRuleResource - Used for configuring OutOfOffice Recurring Rule. 

Resources

/rest/ooo/1.0

...

titleConfigResources

...

titleAttributes

...

titleCreate JQL Exclusion Filter for OOO (POST)

...

STATUS 200

  • successful creation of JQL Exclusion Filter.  

STATUS 401  

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

STATUS 406 

  • NOT_ACCEPTABLE - error in JQL

Can only be performed by an user with Administrator privilege

Example DATA to POST:

Code Block
{
    "exclusionMode": "default",

    "defaultJql": "project = ExampleProject"
}

If exclusion Mode is "user" , "userJql" would be modified instead of "defaultJql". 

Only attributes which needs to be changed are to be added, attributes not specified in the DATA are set to their default values as defined in the attributes table as above. 

...

titleUpdate the OOO advance settings of User (PUT)

...

/ConfigResources


/rest/ooo/1.0/

...

STATUS 200

  • successful update of OOO advance settings

STATUS 401  

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

STATUS 406 

  • NOT_ACCEPTABLE - error in JQL

Example DATA to PUT :

Code Block
{
	 "ignoreSelfAssign": "true",

     "allowCovererAssignBack": "false",

     "oooReplyWhenMentioned": "true"	
}

Only attributes which needs to be changed are to be added, attributes not specified in the DATA are set to their default values as defined in the attributes table as above. 

If only "oooReplyWhenMentioned" needs to be changed, the DATA can be only 

Code Block
{ "oooReplyWhenMentioned": "false"}

...

titleRetrieve the OOO advance settings of user (GET)

...

STATUS 200

  • Returns the Config Object for Rendering

STATUS 401  

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

Return an array of OneTimeRule object

...

Code Block
[
    {
        "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": ""
    }
]

...

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

...

titleCreate a new One-Time Rule (POST)

...

/rest/ooo/1.0/onetimerule

...

titleOutOfOfficeOneTImeRuleResource

...

titleAttributes

...

"-1" will be all other project

If not, it will be the projectId of project

...

The coverer username if reassignMode is set to "coverer"

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

...

Can use "reassign", for re-assigning issue

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

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

...

The ooo user's username

...

titleGetting all your own One-Time Rule (GET)

...

/OutOfOfficeOneTimeRuleResource


/rest/ooo/1.0/

...

Required the following field:

  • assigneeId
  • projectIdString
  • reassignMode
  • covererId if reassignment mode is set to coverer
  • startDateString
  • endDateString

STATUS 200

  • successful creation of new one time rule

STATUS 401  

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

STATUS 406 

...

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

Example Data to POST: 

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

...

titleEdit an existing One-Time Rule (PUT)

...

Required the following field:

  • oneTimeId
  • assigneeId
  • projectIdString
  • reassignMode
  • covererId if reassignment mode is set to coverer
  • startDateString
  • endDateString

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

...

User - Check if user is admin if byAdmin is set to true

OneTimeRule - Check for data format and mandatory data required

Example Data to PUT:

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

...

titleDelete and existing One-Time Rule (DELETE)

...

Required the following field:

  • oneTimeId

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

...

User - Check if user is admin if byAdmin is set to true

OneTimeRule - Check for data format and mandatory data required

Example Data to DELETE:

Code Block
{
	"oneTimeId": "2"
}

...

titleGet all Rule configured by adminstrator

...

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. 

/rest/ooo/1.0/period

...

titleOutOfOfficePeriodResource

...

titleAttributes

...

Message to be added into comment should the user is OOO

(info) This message will be pre-pend infront of the one-time message as comment

...

titleRetrieve all your own Out Of Office period (GET)

...

Return an array of Period object

See above inner class section on data transaction

Example of array returned.

Code Block
[
	{
		"periodMessage": "Out of Office",
		"startDateString": "2018-09-14 12:00",
		"endDateString": "2018-09-20 12:00"
	}
]

...

(info) Does not allow you to search based on assigneeId. It will return all the period configured for the current logged in user

...

titleAdd a new Out Of Office period for yourself (POST)

...

period/OutOfOfficePeriodResource


/rest/ooo/1.0/

...

Required the following field:

  • startDateString
  • endDateString

periodMessage is Optional, if a message is needed.

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

Example Data to POST:

Code Block
{
	"periodMessage": "I am out of office",
	"startDateString": "2018-09-14 12:00",
	"endDateString": "2018-09-20 12:00"
}

...

titleDelete an existing Out Of Office period (DELETE)

...

Required the following field:

  • periodId

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 - invalid user

...

Will perform validateUser() to check if the period belongs to user

Example Data to DELETE:

Code Block
{
	"periodId": "2"
}

...

titleUpdate an existing Out Of Office period (PUT)

...

Required the following field:

  • periodId
  • startDateString
  • endDateString

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

...

Will perform validateUser() to check if the period belongs to user

Example Data to PUT:

Code Block
{
	"periodId": "3",
	"startDateString": "2018-09-14 12:00",
	"endDateString": "2018-09-20 12:00"
}

/rest/ooo/1.0/recurrule

...

titleOutOfOfficeRecurRuleResource

...

titleAttributes

...

"-1" will be all other project

If not, it will be the projectId of project

...

The coverer username if reassignMode is set to "coverer"

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

...

Can use "coverer", for re-assigning issue

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

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

...

titleRetrieve all your own Out Of Office recur rule (GET)

...

Return an array of RecurRule object

...

(info) Does not allow you to search based on assigneeId. It will return all the recur rule configured for the current logged in user

Example 

Code Block
[
    {
        "projectIdString": "10001",
        "covererId": "",
        "covererAvatar": "",
        "covererDisplayName": "",
        "projectInfo": "Akeles [AKELES]",
        "reassignMode": "unassign",
		"oneTimeMessage": "out of office",
 		"oneTimeId": 5
    }
]

...

titleAdd a new Out Of Office recur rule for yourself (POST)

...

Required the following field:

  • recurRuleId
  • assigneeId
  • projectIdString
  • reassignMode
  • covererId if reassignment mode is set to coverer

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

Example Data to POST:

Code Block
{
	"recurRuleId": "1",
	"assigneeId": "10002",
	"projectIdString": "2",
	"reassignMode": "coverer",
	"covererId": "20001"
}

...

titleDelete an existing Out Of Office recur rule (DELETE)

...

Required the following field:

    • recurRuleId

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 - invalid user

...

Will perform validateUser() to check if the recur rule belongs to user

Example Data to DELETE:

Code Block
{
	"recurRuleId": "2"
}

...

titleUpdate an existing Out Of Office recur rule (PUT)

...

Required the following field:

  • recurRuleId
  • assigneeId
  • projectIdString
  • reassignMode
  • covererId if reassignment mode is set to coverer

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

...

Will perform validateUser() to check if the recur rule belongs to user

Example Data to PUT:

...

recurrule/OutOfOfficeRecurRuleResource