Tags:
create new tag
, view all tags

TWiki Variables » Search » Category: Workflow & Automation

COMMENT{ attributes } -- insert an edit box into the topic to easily add comments.

  • A %COMMENT% without parameters shows a simple text box.
  • A %COMMENT{}% can handle the following parameters:
    Parameter Description Default
    type This is the name of the template to use for this comment. Comment templates are defined in a TWiki template - see customization. If this attribute is not defined, the type is whatever is defined by COMMENTPLUGIN_DEFAULT_TYPE, either in this topic or in your WebPreferences. "below"
    default Default text to put into the textarea of the prompt.  
    target Name of the topic to add the comment to the current topic
    location Regular expression specifying the comment location in the target topic. Read carefully the CommentPlugin documentation!  
    mode For compatibility with older versions only, synonymous with type  
    nonotify Set to "on" to disable change notification for target topics "off"
    noform Set to "on" to disable the automatic form that encloses your comment block - remember to insert <form> tags yourself! See CommentPluginExamples#noform for an example. "off"
    nopost Set to "on" to disable insertion of the posted text into the topic. "off"
    remove Set to "on" to remove the comment prompt after the first time it is clicked. "off"
    button Button label text "Add comment"
    emailto Send comment by email. Use comma "," to seperate multiple email addresses. This feature is disabled by default. To enable this feature, please set up "$TWiki::cfg{Plugins}{CommentPlugin}{EmailEnabled} = 1;".  

EXECUTE{ "script" } -- safely execute shell scripts or Perl code - use TWiki as the user interface for external applications

JIRAREST{"..."} -- call JIRA issue tracker using REST API

  • Interface to the Atassian JIRA issue tracker via JIRA REST API call. The %JIRAREST{}% variable is handled by the JiraRestPlugin.
  • Syntax: %JIRAREST{ "..." command="..." }%
  • Parameters:
    Parameter Description Default
    "..." or
    action="..."
    Action to take. This is the REST method: "get" for GET, "put" for PUT, "post" for POST, and "delete" for DELETE method. "" (no action)
    command="..." REST command, such as: "/rest/api/2/issue/TEST-1" (required)
    data="..." Request body sent with REST call, such as: " { \"id\": \"10009\" } " (required for put
    and post actions)
    action2="..."
    command2="..."
    data2="..."
    Conduct a second action after successful execution of the first action. Use this to do multiple REST API calls in one session. No action is taken if there was an error in the first action.
    In the same way, action3, action4, etc can be executed.
    (optional)
    user="..." User for REST call; default is configure setting {Plugins}{JiraRestPlugin}{User} (configure setting)
    password="..." Password for REST call; default is configure setting {Plugins}{JiraRestPlugin}{Password} (configure setting)
  • Example: %JIRAREST{ "get" command="/rest/auth/1/session" }% - see more examples.
  • Category: ApplicationsAndComponentsVariables, DatabaseAndFormsVariables, DevelopmentVariables, ImportVariables, WorkflowAndAutomationVariables
  • Related: JiraRestPlugin (this topic)

SENDMAIL{...} -- send e-mail from actions in TWiki topics, useful for workflow automation

  • The %SENDMAIL{}% variable is handled by the SendMailPlugin.
  • Syntax: %SENDMAIL{ action="send" ... }%
  • Parameters:
    Parameter Description Default
    action="" Only action="send" is supported, it will send an e-mail "" (no action)
    excludetopic="MyTemplate" Exclude action for named topic. Typically used in a template topic containing the SENDMAL variable to disable the action when viewing the topic. "" (no exclude)
    from="admin@example.com" E-mail address or WikiName of sender. If a WikiName is specified, the registered e-mail of that person is used. Supported tokens:
    $webmastername - name of TWiki administrator.
    $webmasteremail - e-mail of TWiki administrator.
    $username - WikiName of logged in user.
    $useremail - e-mail address of the logged in user.
    Defaults to TWiki administrator. See note on open mail relay.
    "$webmastername <$webmasteremail>"
    to="jom@example.com" To list: Comma-space delimited list of e-mail addresses or WikiNames of adressees. Same tokens supported as in from="". Defaults to TWiki administrator. "$webmastername <$webmasteremail>"
    cc="jimmy@example.com" CC list: Comma-space delimited list of e-mails or WikiNames. Same tokens supported as in from="". ""
    bcc="boss@example.com" BCC list: Comma-space delimited list of e-mails or WikiNames. Same tokens supported as in from="". ""
    subject="Any text" E-mail subject. Text may include TWikiVariables such as %URLPARAM{subject}%, and format tokens such as $n and $percnt. (help message)
    text="Any text" or
    plaintext="Any text"
    E-mail body in plain text format. Text may include TWikiVariables and format tokens. (help message)
    htmltext="Any HTML" E-mail body in HTML format, optional. Text may include TWikiVariables and format tokens. Double quotes need to be escaped, such as <a href=\"http://twiki.org/\">TWiki.org<a>. A MIME Multi-Part message is sent if both, plaintext and htmltext are specified. ""
    onsuccess="..." Text shown in place of the SENDMAIL variable on success, default is empty. Text may include TWikiVariables and format tokens. ""
    onerror="| $error ||" Error message shown in place of the SENDMAIL variable on error, if any. Text may include TWikiVariables and format tokens. Token $error expands to the error message. "$error"
  • Security: See note on how to avoid an open mail relay
  • Example:
    %SENDMAIL{ action="send" to="$username <$useremail>" subject="Status change" text="Status changed to %FORMFIELD{Status}%" }%
  • Category: DevelopmentVariables, EmailAndNotificationVariables, WorkflowAndAutomationVariables
  • Related: SendMailPlugin (this topic)

WORKFLOW*{} -- manage workflows

  • Associate a "state" with a topic and then control the work flow that the topic progresses through as content is added. The WorkflowPlugin expands the following variables:
  • Controlling topics in the workflow:
    • %WORKATTACHTOPIC% - Expands to a link that lets you attach to the topic (if the user is not able to modify the topic, either in the workflow sense or according to the standard access controls, the link will be struck out).
    • %WORKEDITTOPIC% - Expands to a link that lets you edit the topic (if the user is not able to modify the topic, either in the workflow sense or according to the standard access controls, the link will be struck out).
    • %WORKFLOWFORK{...}% - Expands to a button that will create a copy of the current topic (see below for more details)
    • %WORKFLOWTRANSITION% - Expands to either (a) a pull-down menu if the user can perform more than one transition, (b) a button if the current user can only perform one transition, or (c) empty space if the current user is not allowed to perform any action. You can change the format of the button using a CSS class.
  • Querying the workflow:
    • %WORKFLOWHISTORY% - Expands to the history of state transitions the topic has undergone. The format of the history is dictated by the WORKFLOWHISTORYFORMAT (described below).
    • %WORKFLOWLASTREV_State% - Expands to the version number when the document was last in the state State.
    • %WORKFLOWLASTTIME_State% - Expands to the timestamp when the document was last in the State last state. For example, %WORKFLOWLASTTIME_APPROVED% would be replaced by the timestamp when the document was last in the APPROVED state.
    • %WORKFLOWLASTVERSION_State% - Expands to a link to the version of the document when it was last in the state State.
    • %WORKFLOWSTATE% - Expands to the current state of the document. It can also be given a topic parameter (default), in which case the state of that topic is returned.
    • %WORKFLOWSTATEMESSAGE% - Expands to the corresponding message in the state table.
  • Category: ApplicationsAndComponentsVariables, EditingAndContentUpdateVariables, WorkflowAndAutomationVariables
  • Related: WorkflowPlugin for details (this topic)

Total: 5 variables

Related Topics: TWikiVariables, TWikiVariablesSearch, TWikiVariablesQuickStart

Topic revision: r1 - 2012-11-11 - TWikiContributor
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.