Versions Compared

Key

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

...

Often you need to run the same action against a set of issues. This describes how to do that using runFromIssueList.

runFromIssueList is like other run actions and how it behaves. It will run the same action for each issue in a issue list determined by a filter or search (JQL). The issue list generated is similar to how getIssueList works. This works by providing a substitution variable that provides the issue key to the common action to run.

...

Tip
titleSubstitution variables

See Substitution variables

Example 1

--action runFromIssueList --search "project = 'zjiracli' and labels != null" --common "--action addLabels --issue @issue@ --labels done-by-action" 

...

  • search is a JQL search, a filter could also be used
  • common is the action that is run for each issue found by the search

Substitution variables

Use @ surrounding the variable name in your action.

...

Example 2

Creating a csv file with the results of action results run across multiple issues.

  1. Delete or clear the output file before starting
  2. Use --append on each request to append the data to an existing file
  3. Depending on the list you are constructing, you may need to use an outputFormat that contains issue field so the resulting file is more useful.
  4. Use release 3.6 or higher.
No Format
--action runFromIssueList --project zjiracliwork --common "--action getWorkList --issue @issue@ --file work.csv --append --outputFormat 2 --dateFormat yyyy-MM-dd"
No Format
titlework.csv
"Issue","Id","Start","Time spent","Time spent (seconds)","Author","Update author","Created","Updated","Comment","Visibility"
"ZWORK-1","22574","2013-07-29","3 hours, 30 minutes","12600","automation","automation","2013-07-29","2013-07-29","My work log entry","Developers"
"ZWORK-1","22576","2011-01-02","1 day, 1 hour","90000","automation","automation","2013-07-29","2013-07-29","",""
"ZWORK-1","22577","2011-01-01","3 hours, 30 minutes","12600","automation","automation","2013-07-29","2013-07-29","","jira-users"
"ZWORK-2","22578","2013-07-29","3 hours, 30 minutes","12600","automation","automation","2013-07-29","2013-07-29","My work log entry","Developers"
"ZWORK-2","22580","2011-01-02","1 day, 1 hour","90000","automation","automation","2013-07-29","2013-07-29","",""
"ZWORK-2","22581","2011-01-01","3 hours, 30 minutes","12600","automation","automation","2013-07-29","2013-07-29","","jira-users"