<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Horowitz</title>
    <description>The latest articles on DEV Community by Daniel Horowitz (@horowitz).</description>
    <link>https://dev.to/horowitz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F210348%2Fca0da01e-6945-4cd8-8cb2-5678c740d193.jpg</url>
      <title>DEV Community: Daniel Horowitz</title>
      <link>https://dev.to/horowitz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/horowitz"/>
    <language>en</language>
    <item>
      <title>Create ways for limiting WIP</title>
      <dc:creator>Daniel Horowitz</dc:creator>
      <pubDate>Sat, 07 Nov 2020 23:16:16 +0000</pubDate>
      <link>https://dev.to/horowitz/create-ways-for-limiting-wip-4k2</link>
      <guid>https://dev.to/horowitz/create-ways-for-limiting-wip-4k2</guid>
      <description>&lt;h2&gt;
  
  
  What is WIP limit and why it's important
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;WIP limits (work-in-process limits) are fixed constraints, typically implemented on Kanban boards, that help teams actively eliminate waste from their processes. WIP limits enable teams to optimize their workflows for value delivery&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay but why is it so important?&lt;/p&gt;

&lt;h3&gt;
  
  
  Get stuff done 💪
&lt;/h3&gt;

&lt;p&gt;WIP limits enforces the team to focus on a smaller set of tasks which improves the throughput and reduces the frustration of having things "nearly done". The result a feeling of getting things done faster&lt;/p&gt;

&lt;h3&gt;
  
  
  Avoid context switching 🤷‍♂️
&lt;/h3&gt;

&lt;p&gt;According to Gloria Mark, Professor of Informatics at the UC – Irvine, "people compensate for interruptions by working faster, but this comes at a price: experiencing more stress, higher frustration, time pressure and effort." &lt;/p&gt;

&lt;h2&gt;
  
  
  How to automate it 🤖
&lt;/h2&gt;

&lt;p&gt;In this article, we will automate the WIP limiting using &lt;code&gt;Jira REST API&lt;/code&gt;. However the approach and key ideas can be replicated for any project software tracking which contains a REST API&lt;/p&gt;

&lt;h3&gt;
  
  
  Jira is your friend 😇
&lt;/h3&gt;

&lt;p&gt;With the following, you can see all Jira issues assigned to you which are &lt;code&gt;In Progress&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;assignee&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;currentUser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;AND&lt;/span&gt; &lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;In Progress&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt; &lt;span class="nx"&gt;by&lt;/span&gt; &lt;span class="nx"&gt;created&lt;/span&gt; &lt;span class="nx"&gt;DESC&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using &lt;code&gt;Jira REST API&lt;/code&gt; it would look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//{{jiraBaseUrl}}/rest/api/3/search?jql=assignee%20%3D%20currentUser()%20AND%20status%20%3D%20"In%20Progress"%20order%20by%20created%20DESC&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using the query above you can easily create reminders for you team to keep the WIP limited&lt;/p&gt;

&lt;h3&gt;
  
  
  Slack reminders
&lt;/h3&gt;

&lt;p&gt;From &lt;a href="https://slack.com/intl/en-es/help/articles/208423427-Set-a-reminder"&gt;slack's reminder documentation&lt;/a&gt; we can create a reminder using the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/remind [@someone or #channel] [what] [when]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In our case, we want to to use the Jira query as the &lt;code&gt;what&lt;/code&gt; here. &lt;/p&gt;

&lt;p&gt;So for a daily personal WIP limit reminder we would have something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="sr"&gt;/remind me to 👋 Limit my WIP at 10am Every weekda&lt;/span&gt;&lt;span class="err"&gt;y
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pro-tip:&lt;/strong&gt; Add a link to "Limit my WIP"  using &lt;code&gt;CMD + Shift + U&lt;/code&gt; and set the Jira URL from the query we've created above&lt;/p&gt;

&lt;h3&gt;
  
  
  Git hooks
&lt;/h3&gt;

&lt;p&gt;If you're not using slack or prefer not to leave the terminal for getting these reminders, you can use git hooks. In our case, we will use &lt;a href="https://git-scm.com/docs/githooks#_post_checkout"&gt;post-checkout&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The reason behind the decision of using this hook is that  normally when starting a new task, at some point the developer will create a new branch using &lt;code&gt;git checkout -b &amp;lt;branch&amp;gt;&lt;/code&gt;  the hook will be triggered right after this command&lt;/p&gt;

&lt;p&gt;Using the Jira query above we are able to create the following &lt;code&gt;post-checkout&lt;/code&gt; git hook&lt;/p&gt;

&lt;p&gt;Here we are using 2 env vars&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;JIRA_API_TOKEN&lt;/code&gt; Api token to authenticate in Jira. &lt;a href="https://confluence.atlassian.com/cloud/api-tokens-938839638.html"&gt;More info here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WIP_LIMIT&lt;/code&gt; env var to set wip limit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also this piece of code is using &lt;code&gt;jq&lt;/code&gt; to retrieve JSON fields&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.ics.uci.edu/~gmark/chi08-mark.pdf"&gt;https://www.ics.uci.edu/~gmark/chi08-mark.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.atlassian.com/agile/kanban/wip-limits"&gt;https://www.atlassian.com/agile/kanban/wip-limits&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.planview.com/resources/articles/wip-limits/"&gt;https://www.planview.com/resources/articles/wip-limits/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>automation</category>
      <category>jira</category>
      <category>scrum</category>
    </item>
  </channel>
</rss>
