Back to column formats
Column formattingSharePoint Online

Issue Status Pill

This format demonstrates how you can reproduce the status choices as pills found in the Microsoft Lists Issue Tracker template..

Issue Status Pill  formatting preview
Sample preview · View original image

Copy. Apply. Make it yours.

Get this format

1 definition

Review the requirements below, then paste this JSON into the matching formatting panel. Show me where.

Use your list's internal column names and replace any tenant-specific URLs or flow IDs. Formatting is presentation, not a way to secure data.

Column formatting
Download JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "flex-wrap": "wrap",
    "display": "flex"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "box-sizing": "border-box",
        "padding": "4px 8px 5px 8px",
        "display": "flex",
        "border-radius": "16px",
        "height": "24px",
        "align-items": "center",
        "white-space": "nowrap",
        "overflow": "hidden",
        "margin": "4px 4px 4px 4px"
      },
      "attributes": {
        "class": {
          "operator": ":",
          "operands": [
            {
              "operator": "==",
              "operands": [
                "@currentField",
                "Blocked"
              ]
            },
            "sp-css-backgroundColor-errorBackground50 sp-css-color-redDark",
            {
              "operator": ":",
              "operands": [
                {
                  "operator": "==",
                  "operands": [
                    "@currentField",
                    "In progress"
                  ]
                },
                "sp-css-backgroundColor-neutralBackground10",
                {
                  "operator": ":",
                  "operands": [
                    {
                      "operator": "==",
                      "operands": [
                        "@currentField",
                        "Completed"
                      ]
                    },
                    "sp-css-backgroundColor-successBackground40 sp-css-color-green",
                    {
                      "operator": ":",
                      "operands": [
                        {
                          "operator": "==",
                          "operands": [
                            "@currentField",
                            "Duplicate"
                          ]
                        },
                        "sp-css-backgroundColor-warningBackground50 sp-css-color-themeDarker",
                        {
                          "operator": ":",
                          "operands": [
                            {
                              "operator": "==",
                              "operands": [
                                "@currentField",
                                "By design"
                              ]
                            },
                            "sp-css-backgroundColor-blueBackground07 sp-css-color-neutralPrimary",
                            {
                              "operator": ":",
                              "operands": [
                                {
                                  "operator": "==",
                                  "operands": [
                                    "@currentField",
                                    "Won't fix"
                                  ]
                                },
                                "sp-css-backgroundColor-errorBackground sp-css-color-redDark",
                                {
                                  "operator": ":",
                                  "operands": [
                                    {
                                      "operator": "==",
                                      "operands": [
                                        "@currentField",
                                        "New"
                                      ]
                                    },
                                    "sp-css-backgroundColor-blueBackground17 sp-css-color-blue",
                                    ""
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      "children": [
        {
          "elmType": "span",
          "style": {
            "line-height": "16px",
            "height": "14px"
          },
          "attributes": {
            "iconName": {
              "operator": ":",
              "operands": [
                {
                  "operator": "==",
                  "operands": [
                    "@currentField",
                    "Blocked"
                  ]
                },
                "",
                {
                  "operator": ":",
                  "operands": [
                    {
                      "operator": "==",
                      "operands": [
                        "@currentField",
                        "In progress"
                      ]
                    },
                    "",
                    {
                      "operator": ":",
                      "operands": [
                        {
                          "operator": "==",
                          "operands": [
                            "@currentField",
                            "Completed"
                          ]
                        },
                        "",
                        {
                          "operator": ":",
                          "operands": [
                            {
                              "operator": "==",
                              "operands": [
                                "@currentField",
                                "Duplicate"
                              ]
                            },
                            "",
                            {
                              "operator": ":",
                              "operands": [
                                {
                                  "operator": "==",
                                  "operands": [
                                    "@currentField",
                                    "By design"
                                  ]
                                },
                                "",
                                {
                                  "operator": ":",
                                  "operands": [
                                    {
                                      "operator": "==",
                                      "operands": [
                                        "@currentField",
                                        "Won't fix"
                                      ]
                                    },
                                    "",
                                    {
                                      "operator": ":",
                                      "operands": [
                                        {
                                          "operator": "==",
                                          "operands": [
                                            "@currentField",
                                            "New"
                                          ]
                                        },
                                        "",
                                        ""
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          }
        },
        {
          "elmType": "span",
          "style": {
            "overflow": "hidden",
            "text-overflow": "ellipsis",
            "padding": "0 3px"
          },
          "txtContent": "@currentField",
          "attributes": {
            "class": {
              "operator": ":",
              "operands": [
                {
                  "operator": "==",
                  "operands": [
                    "@currentField",
                    "Blocked"
                  ]
                },
                "",
                {
                  "operator": ":",
                  "operands": [
                    {
                      "operator": "==",
                      "operands": [
                        "@currentField",
                        "In progress"
                      ]
                    },
                    "",
                    {
                      "operator": ":",
                      "operands": [
                        {
                          "operator": "==",
                          "operands": [
                            "@currentField",
                            "Completed"
                          ]
                        },
                        "",
                        {
                          "operator": ":",
                          "operands": [
                            {
                              "operator": "==",
                              "operands": [
                                "@currentField",
                                "Duplicate"
                              ]
                            },
                            "",
                            {
                              "operator": ":",
                              "operands": [
                                {
                                  "operator": "==",
                                  "operands": [
                                    "@currentField",
                                    "By design"
                                  ]
                                },
                                "",
                                {
                                  "operator": ":",
                                  "operands": [
                                    {
                                      "operator": "==",
                                      "operands": [
                                        "@currentField",
                                        "Won't fix"
                                      ]
                                    },
                                    "",
                                    {
                                      "operator": ":",
                                      "operands": [
                                        {
                                          "operator": "==",
                                          "operands": [
                                            "@currentField",
                                            "New"
                                          ]
                                        },
                                        "",
                                        ""
                                      ]
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          }
        }
      ]
    }
  ]
}

From the contributor

How to use this sample

Summary

This format demonstrates how you can reproduce the status choices as pills found in the Microsoft Lists Issue Tracker template..

You can use this formatting to implement your own version of the choices as pills formatting.

screenshot of the sample

View requirements

  • This format can be applied to any text/choice column, but expects the column values to be one of the following choices:
    • Blocked
    • In progress
    • Completed
    • Duplicate
    • By design
    • Won't fix
    • New

Sample

Solution Author(s)
generic-issuestatus-pill.json Hugo Bernier

Version history

Version Date Comments
1.0 July 30, 2020 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Additional notes