public void addPriority(JiraServer server, JiraNamedEntity priority)
 {
     lock (priorityCache)
     {
         if (!priorityCache.ContainsKey(server.GUID))
         {
             priorityCache[server.GUID] = new SortedDictionary<int, JiraNamedEntity>();
         }
         priorityCache[server.GUID][priority.Id] = priority;
     }
 }
 public void addStatus(JiraServer server, JiraNamedEntity status)
 {
     lock (statusCache)
     {
         if (!statusCache.ContainsKey(server.GUID))
         {
             statusCache[server.GUID] = new SortedDictionary<int, JiraNamedEntity>();
         }
         statusCache[server.GUID][status.Id] = status;
     }
 }
 public void addIssueType(JiraServer server, JiraNamedEntity issueType)
 {
     lock(issueTypeCache)
     {
         if (!issueTypeCache.ContainsKey(server.GUID))
         {
             issueTypeCache[server.GUID] = new SortedDictionary<int, JiraNamedEntity>();
         }
         issueTypeCache[server.GUID][issueType.Id] = issueType;
     }
 }
 public void runIssueActionWithoutParams(JiraIssue issue, JiraNamedEntity action)
 {
     getSoapSession(issue.Server).runIssueActionWithoutParams(issue, action.Id);
 }
 private static void loadIssueTypes(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_COUNT), 0);
     for (int i = 0; i < count; ++i)
     {
         int id = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_ID + i), 0);
         string name = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_NAME + i), null);
         JiraNamedEntity issueType = new JiraNamedEntity(id, name, null);
         f.IssueTypes.Add(issueType);
     }
 }
 private static void loadFixVersions(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_COUNT), 0);
     for (int i = 0; i < count; ++i)
     {
         int id = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_ID + i), 0);
         string name = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_NAME + i), null);
         JiraNamedEntity fixVersion = new JiraNamedEntity(id, name, null);
         f.FixForVersions.Add(fixVersion);
     }
 }
 private static void loadComponents(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_COUNT), 0);
     for (int i = 0; i < count; ++i)
     {
         int id = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_ID + i), 0);
         string name = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_NAME + i), null);
         JiraNamedEntity comp = new JiraNamedEntity(id, name, null);
         f.Components.Add(comp);
     }
 }
 public void runIssueActionWithoutParams(JiraIssue issue, JiraNamedEntity action)
 {
     getSoapSession(issue.Server).runIssueActionWithoutParams(issue, action.Id);
 }
 public IssueTypeListViewItem(JiraNamedEntity issueType, int imageIdx) : base(issueType.Name, imageIdx)
 {
     IssueType = issueType;
 }
 private void runAction(JiraNamedEntity action)
 {
     Thread runner = new Thread(new ThreadStart(delegate
        {
            try
            {
                status.setInfo("Retrieveing fields for action \"" + action.Name + "\"...");
                var fields = JiraServerFacade.Instance.getFieldsForAction(issue, action.Id);
                if (fields == null || fields.Count == 0)
                {
                    runActionLocally(action);
                }
                else
                {
                    status.setInfo("Action \"" + action.Name
                        + "\" requires input fields, opening action screen in the browser...");
                    Process.Start(issue.Server.Url
                        + "/secure/WorkflowUIDispatcher.jspa?id=" + issue.Id
                        + "&action=" + action.Id);
                }
            }
            catch (Exception e)
            {
                status.setError("Failed to run action " + action.Name + " on issue " + issue.Key, e);
            }
        }));
     runner.Start();
 }
 private void runActionLocally(JiraNamedEntity action)
 {
     status.setInfo("Running action \"" + action.Name + "\" on issue " + issue.Key + "...");
     JiraServerFacade.Instance.runIssueActionWithoutParams(issue, action);
     status.setInfo("Action \"" + action.Name + "\" successfully run on issue " + issue.Key);
     var newIssue = JiraServerFacade.Instance.getIssue(issue.Server, issue.Key);
     Invoke(new MethodInvoker(() => model.updateIssue(newIssue)));
 }