Versions Compared

Key

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

...

Section
indextrue
show-titlefalse
titleDescription

Adds, removes, and applies changes to properties and sections of a  projectdoc document.

Use

  • from [space keys]
  • where [constraints]

to select on projectdoc documents. All documents in the result set will have applied the changes specified in the patch document.


Transclusion
documentPlease Backup your Data first!
idsSummary


If your environment does not support the HTTP PATCH method try to use the patch resource at projectdoc/1/patch/document as a workaround.

The patch document has the following form (JSON):

Content Marker
iddocument-representation


Code Block
languagejs
  {
    "property": [
      {
        "name": "New Property",
        "value": "My Value",
        "controls": "",
        "position": "after",
        "ref": "Name"
      }
    ],
    "section": [
      {
        "title": "My Section",
        "content": "<p>Some text</p>",
        "position": "before",
        "ref": "References"
      }
    ]
  }

The name, value, and controls specify the values for the property to apply. The title and content specify the information for the section.

The position and ref specify the position where to add the property or section. The position may be one of the following keywords, while ref (that is: reference) specifies the name of a property or title of a section relative to which the position is evaluated.

PositionTargetSupports refDescription
beforeProperty (tick) Add the property before the property specified by ref. If the referenced property is not found, a 404 will be returned for that document.
beforeSection (tick) Add the section before the section specified by ref. If the referenced section is not found, a 404 will be returned for that document.
afterProperty (tick) Add the property after the property specified by ref. If the referenced property is not found, a 404 will be returned for that document.
afterSection (tick) Add the section after the section specified by ref. If the referenced section is not found, a 404 will be returned for that document.
firstProperty (error) Add the property in front of all properties.
firstSection (error) Add the section in front of all sections.
lastProperty (error) Add the property after all properties.
lastSection (error) Add the section after all sections.
deleteProperty (error) Deletes the specified property.
deleteSection (error) Deletes the specified section
replaceProperty (question) Replaces the specified property with this information. The ref references the property to be replaced (defaults to name).
mergeProperty (question)

Merges the specified property with this information. If no information is provided for value or controls, the existing information is not changed. The ref references the property to have the new information merged into (defaults to name).

Since version 4.10 this position allows to rename a property if value and controls are empty.

merge-valuesProperty (question) Like merge but also merges properties provided into list values. Available since version 3.1.
delete-valuesProperty (error) Like merge-values but removes the elements from the property list value. Available since version 3.1.
replace-valuesProperty(question)Like merge-values but clears the values before inserting the new. Available since version 6.0.
replace-or-addProperty (question) Replaces the property with the given name if it exist, otherwise adds a new property at the end. The ref references the property to be replaced (defaults to name).
replaceSection (question) Replaces the specified section. The ref references the section to be replaced (defaults to title).


If a query is executed, the from parameter is required.

...