Class WorkItems
- java.lang.Object
-
- org.azd.WorkitemTracking.WorkItems.WorkItems
-
- All Implemented Interfaces:
WorkItemDetails
public class WorkItems extends Object implements WorkItemDetails
-
-
Constructor Summary
Constructors Constructor Description WorkItems(AzDDefaultParameters defaultParameters)
Instantiate the class with instance of AzDDefaultParameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkItem
createWorkItem(String workItemType, WorkItemOperation operation, String title)
Creates a single work item.WorkItem
createWorkItem(String workItemType, WorkItemOperation operation, String title, String description, String[] tags)
Creates a single work item.WorkItemDelete
deleteWorkItem(int id)
Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required.WorkItemDelete
deleteWorkItem(int id, boolean destroy)
Deletes the specified work item permanently if the destroy parameter has been set to true, WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion.WorkItem
getWorkItem(int id)
Returns a single work item.WorkItem
getWorkItem(int id, WorkItemExpand expand)
Returns a single work item.WorkItem
getWorkItem(int id, WorkItemExpand expand, String asOf)
Returns a single work item.WorkItem
getWorkItem(int id, WorkItemExpand expand, String[] fields)
Returns a single work item.WorkItem
getWorkItem(int id, WorkItemExpand expand, String[] fields, String asOf)
Returns a single work item.WorkItem
getWorkItemRevision(int workItemId, int revisionNumber)
Returns a fully hydrated work item for the requested revisionWorkItem
getWorkItemRevision(int workItemId, int revisionNumber, WorkItemExpand expand)
Returns a fully hydrated work item for the requested revisionWorkItemList
getWorkItemRevisions(int workItemId)
Returns the list of fully hydrated work item revisions.WorkItemList
getWorkItemRevisions(int workItemId, WorkItemExpand expand)
Returns the list of fully hydrated work item revisions.WorkItemList
getWorkItemRevisions(int workItemId, WorkItemExpand expand, int top, int skip)
Returns the list of fully hydrated work item revisions, paged.WorkItemList
getWorkItems(int[] ids)
Returns a list of work items (Maximum 200)WorkItemList
getWorkItems(int[] ids, WorkItemExpand expand)
Returns a list of work items (Maximum 200)WorkItemList
getWorkItems(int[] ids, WorkItemExpand expand, String asOf)
Returns a list of work items (Maximum 200)WorkItemList
getWorkItems(int[] ids, WorkItemExpand expand, String[] fields)
Returns a list of work items (Maximum 200)WorkItemList
getWorkItems(int[] ids, WorkItemExpand expand, String[] fields, String asOf, WorkItemErrorPolicy errorPolicy)
Returns a list of work items (Maximum 200)
-
-
-
Constructor Detail
-
WorkItems
public WorkItems(AzDDefaultParameters defaultParameters)
Instantiate the class with instance of AzDDefaultParameters- Parameters:
defaultParameters
- instance of AzDDefaultParameters
-
-
Method Detail
-
createWorkItem
public WorkItem createWorkItem(String workItemType, WorkItemOperation operation, String title) throws DefaultParametersException, AzDException
Creates a single work item.- Specified by:
createWorkItem
in interfaceWorkItemDetails
- Parameters:
workItemType
- The work item type of the work item to create. e.g., "user story", "bug", "task"operation
- The patch operationWorkItemOperation
title
- The title for the work item- Returns:
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
createWorkItem
public WorkItem createWorkItem(String workItemType, WorkItemOperation operation, String title, String description, String[] tags) throws DefaultParametersException, AzDException
Creates a single work item.- Specified by:
createWorkItem
in interfaceWorkItemDetails
- Parameters:
workItemType
- The work item type of the work item to create. e.g., "user story", "bug", "task"operation
- The patch operationWorkItemOperation
title
- The title for the work itemdescription
- Description for the work itemtags
- Tags for the work item- Returns:
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
deleteWorkItem
public WorkItemDelete deleteWorkItem(int id) throws DefaultParametersException, AzDException
Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required.- Specified by:
deleteWorkItem
in interfaceWorkItemDetails
- Parameters:
id
- ID of the work item to be deleted- Returns:
WorkItemDelete
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
deleteWorkItem
public WorkItemDelete deleteWorkItem(int id, boolean destroy) throws DefaultParametersException, AzDException
Deletes the specified work item permanently if the destroy parameter has been set to true, WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution.- Specified by:
deleteWorkItem
in interfaceWorkItemDetails
- Parameters:
id
- ID of the work item to be deleteddestroy
- Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone.- Returns:
WorkItemDelete
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItem
public WorkItem getWorkItem(int id) throws DefaultParametersException, AzDException
Returns a single work item.- Specified by:
getWorkItem
in interfaceWorkItemDetails
- Parameters:
id
- The work item id- Returns:
- WorkItem
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItem
public WorkItem getWorkItem(int id, WorkItemExpand expand) throws DefaultParametersException, AzDException
Returns a single work item.- Specified by:
getWorkItem
in interfaceWorkItemDetails
- Parameters:
id
- The work item idexpand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
- Returns:
- WorkItem
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItem
public WorkItem getWorkItem(int id, WorkItemExpand expand, String asOf) throws DefaultParametersException, AzDException
Returns a single work item.- Specified by:
getWorkItem
in interfaceWorkItemDetails
- Parameters:
id
- The work item idexpand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
asOf
- AsOf UTC date time string- Returns:
- WorkItem
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItem
public WorkItem getWorkItem(int id, WorkItemExpand expand, String[] fields) throws DefaultParametersException, AzDException
Returns a single work item.- Specified by:
getWorkItem
in interfaceWorkItemDetails
- Parameters:
id
- The work item idexpand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
fields
- Comma-separated list of requested fields- Returns:
- WorkItem
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItem
public WorkItem getWorkItem(int id, WorkItemExpand expand, String[] fields, String asOf) throws DefaultParametersException, AzDException
Returns a single work item.- Specified by:
getWorkItem
in interfaceWorkItemDetails
- Parameters:
id
- The work item idexpand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
fields
- Comma-separated list of requested fieldsasOf
- AsOf UTC date time string- Returns:
- WorkItem
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItems
public WorkItemList getWorkItems(int[] ids) throws DefaultParametersException, AzDException
Returns a list of work items (Maximum 200)- Specified by:
getWorkItems
in interfaceWorkItemDetails
- Parameters:
ids
- Integer array of requested work item ids. (Maximum 200 ids allowed).- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItems
public WorkItemList getWorkItems(int[] ids, WorkItemExpand expand) throws DefaultParametersException, AzDException
Returns a list of work items (Maximum 200)- Specified by:
getWorkItems
in interfaceWorkItemDetails
- Parameters:
ids
- Integer array of requested work item ids. (Maximum 200 ids allowed).expand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItems
public WorkItemList getWorkItems(int[] ids, WorkItemExpand expand, String asOf) throws DefaultParametersException, AzDException
Returns a list of work items (Maximum 200)- Specified by:
getWorkItems
in interfaceWorkItemDetails
- Parameters:
ids
- Integer array of requested work item ids. (Maximum 200 ids allowed).expand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
asOf
- AsOf UTC date time string- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItems
public WorkItemList getWorkItems(int[] ids, WorkItemExpand expand, String[] fields) throws DefaultParametersException, AzDException
Returns a list of work items (Maximum 200)- Specified by:
getWorkItems
in interfaceWorkItemDetails
- Parameters:
ids
- Integer array of requested work item ids. (Maximum 200 ids allowed).expand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
fields
- Comma-separated list of requested fields- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItems
public WorkItemList getWorkItems(int[] ids, WorkItemExpand expand, String[] fields, String asOf, WorkItemErrorPolicy errorPolicy) throws DefaultParametersException, AzDException
Returns a list of work items (Maximum 200)- Specified by:
getWorkItems
in interfaceWorkItemDetails
- Parameters:
ids
- Integer array of requested work item ids. (Maximum 200 ids allowed).expand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
fields
- Comma-separated list of requested fieldsasOf
- AsOf UTC date time stringerrorPolicy
- The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}.WorkItemErrorPolicy
- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItemRevisions
public WorkItemList getWorkItemRevisions(int workItemId) throws DefaultParametersException, AzDException
Returns the list of fully hydrated work item revisions.- Specified by:
getWorkItemRevisions
in interfaceWorkItemDetails
- Parameters:
workItemId
- The id of the work item- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItemRevisions
public WorkItemList getWorkItemRevisions(int workItemId, WorkItemExpand expand) throws DefaultParametersException, AzDException
Returns the list of fully hydrated work item revisions.- Specified by:
getWorkItemRevisions
in interfaceWorkItemDetails
- Parameters:
workItemId
- The id of the work itemexpand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItemRevisions
public WorkItemList getWorkItemRevisions(int workItemId, WorkItemExpand expand, int top, int skip) throws DefaultParametersException, AzDException
Returns the list of fully hydrated work item revisions, paged.- Specified by:
getWorkItemRevisions
in interfaceWorkItemDetails
- Parameters:
workItemId
- The id of the work itemexpand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
top
- Specify top pages to listskip
- Specify to skip pages- Returns:
WorkItemList
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItemRevision
public WorkItem getWorkItemRevision(int workItemId, int revisionNumber) throws DefaultParametersException, AzDException
Returns a fully hydrated work item for the requested revision- Specified by:
getWorkItemRevision
in interfaceWorkItemDetails
- Parameters:
workItemId
- The id of the work itemrevisionNumber
- The work item revision number- Returns:
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
getWorkItemRevision
public WorkItem getWorkItemRevision(int workItemId, int revisionNumber, WorkItemExpand expand) throws DefaultParametersException, AzDException
Returns a fully hydrated work item for the requested revision- Specified by:
getWorkItemRevision
in interfaceWorkItemDetails
- Parameters:
workItemId
- The id of the work itemrevisionNumber
- The work item revision numberexpand
- The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.WorkItemExpand
- Returns:
WorkItem
- Throws:
DefaultParametersException
- user must instantiate AzDDefaultParameters before calling this methodAzDException
- Exception handler
-
-