On 05/03/2011 06:01 PM, Arun C Murthy wrote: > On May 3, 2011, at 5:17 PM, "Doug Cutting" <[email protected]> wrote: > >> On 05/02/2011 02:33 PM, Arun C Murthy wrote: >>> Are you simply asking for someone to go through the 450 odd jiras and >>> set 'fix-for' fields? >> >> Every other release we've made is well-correlated with Jira. It should >> not be difficult to achieve that for this one. We could write a script >> to take all 450 bug IDs from the change log and use Jira's command-line >> tool to set the "fix-for" to be this 0.20+security release. Would you >> like help with that? >> > > Yes please, that would be great. Thanks!
Please find below a script that will add a fix-version to issues. Doug #!/bin/bash # reads bug ids from standard input # and adds the fixVersion named on command line if [ $# -eq 0 ] then echo "Usage: $0 bugid" exit 1 fi fix=$1 echo Setting fix version to $fix. server=https://issues.apache.org/jira jira=./jira-cli-2.0.0/jira.sh set -e echo -n "Jira username: " read user echo -n "Jira password: " stty -echo read password stty echo while read issue do # first read the old fix versions old=`$jira -a getFieldValue --server $server \ --password $password --user $user \ --issue $issue --field fixVersions | \ tail -n 1 | sed 's/([0-9]*)//g' | sed s/\'//g` # now update, adding new value # jira will ignore if this value is already present $jira -a updateIssue --server $server \ --password $password --user $user \ --issue $issue --fixVersions "${old},${fix}" done
