Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added the ability to hard-code custom field values for workflow trans…

…itions.
  • Loading branch information...
commit a77b1996f37fefa9a94448de24a833b34ce11bcc 1 parent 8b32ff7
@csharptest authored
View
10 src/SvnJiraIntegration/JiraConnection.cs
@@ -32,6 +32,7 @@ class JiraConnection : IIssuesServiceConnection
readonly JiraUser _currentUser;
readonly Dictionary<string, JiraUser> _knownUsers;
readonly Dictionary<string, JiraStatus> _statuses;
+ readonly Converter<string, string> _settings;
readonly JiraSoapServiceService _service;
private string _token;
@@ -43,6 +44,7 @@ public JiraConnection(string url, string userName, string password, Converter<st
if (offset > 0)
_rootUrl = _rootUrl.Substring(0, offset);
+ _settings = settings;
_knownUsers = new Dictionary<string, JiraUser>(StringComparer.OrdinalIgnoreCase);
_lookupUsers = StringComparer.OrdinalIgnoreCase.Equals(settings("resolveUserNames"), "true");
LoadUsers();
@@ -268,7 +270,15 @@ internal void ProcessAction(JiraIssue issue, IIssueAction action, IIssueUser ass
else if (StringComparer.OrdinalIgnoreCase.Equals("Worklog", paramName)) // JIRA 4.1 - worklogs are required!
continue;
else
+ {
param.values = issue.GetFieldValue(paramName);
+ if (param.values == null || param.values.Length == 0 || (param.values.Length == 1 && param.values[0] == null))
+ {
+ string setting = _settings(String.Format("{0}:{1}", action.Name, field.name));
+ if(setting != null)
+ param.values = new string[] { setting };
+ }
+ }
actionParams.Add(param);
}
View
8 src/SvnPlugin/app.config
@@ -65,5 +65,13 @@ Copyright 2008-2009 by Roger Knapp, Licensed under the Apache License, Version 2
on an issue, recording in the form of (\d+[wdhm](\s\d+[wdhm]))+
-->
<add key="enableWorklog" value="true"/>
+
+ <!--
+ Custom Fields - You may now hard-code the value for any required custom field in jira
+ by specifying both the action and field name seperated by a ':'. thus to set customfield_10030
+ to the value 'true' for the 'Resolve' action you would specify the following:
+
+ <add key="Resolve:customfield_10030" value="true"/>
+ -->
</appSettings>
</configuration>
Please sign in to comment.
Something went wrong with that request. Please try again.