Beispiel #1
0
        protected void CreateClient()
        {
            string username = Credential.UserName;
            string password = Credential.GetNetworkCredential().Password;

            try
            {
                string message = $"Connecting to Jira Endpoint [{Uri}] with Username [{Credential.UserName}]";
                WriteVerbose(message);

                JSession.Open(Uri, username, password);

                WriteDebug("Issuing basic request to verify connectivity [Get Priorities]");
                new AsyncResult(
                    message,
                    JSession.Api.Priorities.GetPrioritiesAsync()
                    ).Wait();
            }
            catch (Exception ex)
            {
                // clear invalid session
                JSession.Close();
                throw new JiraConnectionException(ex.Message, ex);
            }
        }
Beispiel #2
0
        protected override void EndProcessing()
        {
            var session = new JSession();

            if (session.IsConnected)
            {
                WriteObject(session);
            }
            else
            {
                WriteVerbose("No Jira session is available.");
            }
        }
Beispiel #3
0
 protected override void EndProcessing()
 {
     JSession.Close();
 }