Wednesday, June 02, 2021

How can we bulk close issues on JIRA?

Here is how we can bulk close JIRAs

Step 1: Search all the issues/stories you wan to close (Using JQL or predefined filter of your own),  something like below.




Step 2: Choose the issues that needs to be closed.

Step 3: Choose Operation, Since we are closing, we need to select transition issues and go to next. 

Step 4: Choose the operation from available workflow actions







Step 5: Here I have choosed Resolved as i am closing these issues.

Step 6: Select Resolved and proceed further.









Step 7: Add comments (optional) and choose resolution













Step 8: Choose confirm to bulk close all the tickets.










Easy right!!

Tuesday, June 01, 2021

Visual Studio 2019 Tips and Tricks

Visual Studio 2019 has a new feature with visibility into how an external library or dependency resource is handling the data you are giving it can provide valuable insight. Debugging decompiled resources is a great feature that allows to step into external libraries.

Select Tools > Options. Type “decompile” into the search bar. The Advanced section of Text Editor for C# will appear. Click on Advanced.
  

Check the box that says Enable navigation to decompiled sources (experimental).

Now you can debug and step into the external packages you pull in from Nuget and elsewhere! 

Happy Debugging!!

Saturday, May 29, 2021

How to Get Columns details from SQL Tables

Here is how you can get column names from specified table

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns 
WHERETABLE_NAME = 'MobilityOrders'

Here is how you can get column count from specified table

SELECT COUNT(COLUMN_NAME) as COUNT FROM INFORMATION_SCHEMA.Columns 
WHERE TABLE_NAME = 'MobilityOrders'

Here is how you can get column count from temp table

 SELECT COUNT(*) as Cnt FROM tempdb.sys.columns
 WHERE object_id = object_id('tempdb..#temp2')

Hope this helps 😀

Friday, May 21, 2021

How to: Looping through reader count dynamically C#

Here is how this can be done once you have the data call via Read methods
   
using (var reader = await sqlDbContext.ExecuteReaderAsync(command))
{
   
    while (await sqlDbContext.ReadAsync(reader))
    {
        // when count greaterthan 1
        if (reader.FieldCount > 1)
        {
            if (!string.IsNullOrEmpty(reader["ItemD"].ToString()))
            {
                mobilityChangeOrdersItem.ItemID= reader["ItemID"] == null ? 0 : Convert.ToInt32(reader["ItemID"].ToString());
            }
            if (!string.IsNullOrEmpty(reader["ID"].ToString()))
            {
                mobilityChangeOrdersItem.ID = reader["ID"] == null ? 0 : Convert.ToInt32(reader["ID"].ToString());
            }
        }
    }

    //Looping through complete list of return variables to find out requrired column
    string errorMessge = " SQL Message: -- *Start* ItemD -- :: " + mobilityChangeOrdersItem.ItemD;
    while (await reader.NextResultAsync())
    {
        var fieldvalues = Enumerable.Range(0, reader.FieldCount).Select(i => reader.GetName(i)).ToArray();

        while (await reader.ReadAsync())
        {
            if (fieldvalues.Contains("ErrorMessage"))
            { 
                errorMessge += Environment.NewLine + " ErrorMessage : " + reader["ErrorMessage"].ToString();
            }
            if (fieldvalues.Contains("ErrorProcedure"))
            {
                errorMessge += Environment.NewLine + " ErrorProcedure : " + reader["ErrorProcedure"].ToString();
            }
        }
        errorMessge += Environment.NewLine + " SQL Message: -- *End*";
        mobilityChangeOrdersItem.StatusMessage = errorMessge;
    } 
    mobilityChangeOrdersList.Add(mobilityChangeOrdersItem);
}

Hope this helps 😀

How to : Check if a column exists in a datareader in C#

 Here is how we can do in  C# supported Frameworks!!

var fieldvalues = Enumerable.Range(0, reader.FieldCount).Select(i => reader.GetName(i)).ToArray();

//get column name here
if (fieldvalues.Contains("ErrorMessage"))
{
    errorMessge += Environment.NewLine + " ErrorMessage : " + reader["ErrorMessage"].ToString();
}
//get column name here
if (fieldvalues.Contains("ErrorProcedure"))
{
    errorMessge += Environment.NewLine + " ErrorProcedure : " + reader["ErrorProcedure"].ToString();
}

BTW, ErrorMessage will return the value after checking these fields 

Hope this helps 😀