Interface ActionItemApi


public interface ActionItemApi
Utility class to work with Action Items in Groovy code

Get it with api.actionItemApi(). It creates new Action Items (newActionItem()) and works with an existing Action Item by its ID (withId(Long)): it updates, deletes or recalculates it. It also returns the configured limits for newly created Action Items (getNewRecordsMaxLimits()).

The operations work only in contexts that allow object modification, and not in the "input generation" mode. In other contexts, ActionItemApi.ActionItemBuilder.create(), ActionItemApi.ActionItemBuilder.doUpdate(), ActionItemApi.ActionItemBuilder.doRecalculate() and ActionItemApi.ActionItemBuilder.doExecute() return null, and ActionItemApi.ActionItemBuilder.doDelete() does nothing.

Example:


 if (!api.isInputGenerationExecution()) {
     def actionItem = api.actionItemApi().newActionItem()
         .setSummary("Review the price increase")
         .setType("__DEFAULT__")
         .setAssignedTo(2147490696)
         .create()
 }
 
Since:
11.0 - Paper Plane
See Also:
  • Method Details

    • newActionItem

      Initiates a builder object to create a new Action Item (AI). The operation is finished with the ActionItemApi.ActionItemBuilder.create() method.

      Example:

      
       def actionItem = api.actionItemApi().newActionItem()
         .setSummary("A brief title of the Action Item")
         .setType("__DEFAULT__")
         .setAssignedTo(userId)
         .create()
         
      Returns:
      a new instance of ActionItemBuilder
      Since:
      11.0 - Paper Plane
    • withId

      ActionItemApi.ActionItemBuilder withId(Long actionItemId)
      Initiates an operation with an existing Action Item (specified by ID). Supported operations are update and delete.

      Example – updates the existing Action Item:

      
       def actionItemId = 123
      
       def actionItem = api.actionItemApi().withId(actionItemId)
           .setSummary("An updated summary.")
           .doUpdate()
       
      Parameters:
      actionItemId - The id of an existing Action Item
      Returns:
      a new instance of ActionItemBuilder
      Since:
      11.0 - Paper Plane
    • getNewRecordsMaxLimits

      Map<String,Integer> getNewRecordsMaxLimits()
      Returns configured limits for newly created action items.

      Example:

      
       def limits = api.actionItemApi().getNewRecordsMaxLimits()
       api.logInfo("At most ${limits.limit} new Action Items per ${limits.timePeriod} seconds")
       
      Returns:
      Map containing two keys:
      • limit: number of newly created action items within a given time period
      • timePeriod: timeframe in seconds within the limit is enforced. A counter of newly created action items is reset after the period elapses.
      Since:
      11.2 - Paper Plane