<?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: Jakeem Dean</title>
    <description>The latest articles on DEV Community by Jakeem Dean (@ravenknighth2o).</description>
    <link>https://dev.to/ravenknighth2o</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271912%2F59e9a15d-07eb-47c4-9382-e9be88c7c349.png</url>
      <title>DEV Community: Jakeem Dean</title>
      <link>https://dev.to/ravenknighth2o</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ravenknighth2o"/>
    <language>en</language>
    <item>
      <title>3 Jira Forge traps that cost us hours (and the fixes)</title>
      <dc:creator>Jakeem Dean</dc:creator>
      <pubDate>Sun, 29 Nov 2026 08:05:59 +0000</pubDate>
      <link>https://dev.to/ravenknighth2o/3-jira-forge-traps-that-cost-us-hours-and-the-fixes-kig</link>
      <guid>https://dev.to/ravenknighth2o/3-jira-forge-traps-that-cost-us-hours-and-the-fixes-kig</guid>
      <description>&lt;p&gt;We built a small Jira Cloud app on Atlassian Forge this month: a checklist panel for Jira work items, with UI Kit, Custom Entities storage and a delete trigger. The Forge templates got us to "hello world" in an afternoon. Most of the time after that went into problems the templates never mention.&lt;/p&gt;

&lt;p&gt;Here are three of them, in full. Each one says &lt;strong&gt;what happens&lt;/strong&gt;, &lt;strong&gt;the fix&lt;/strong&gt;, and &lt;strong&gt;how we know&lt;/strong&gt;: whether we hit it live, caught it in code review, read it in Atlassian's docs, or only have a secondhand report. Where we didn't test something, we say so.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Forge checks no permissions for you
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What happens.&lt;/strong&gt; A resolver runs with your app's power, not the user's. Jira only decides who can &lt;em&gt;see&lt;/em&gt; the work item your panel sits on. Nothing stops a user who can only view a work item from adding, ticking or deleting your app's data on it, unless your code asks Jira first.&lt;/p&gt;

&lt;p&gt;Our first build let view-only users write. A code review caught it before any user did.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; Before every write, ask Jira, as the user, whether they may edit that work item:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;route&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@forge/api'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;asUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;requestJira&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;route&lt;/span&gt;&lt;span class="sb"&gt;`/rest/api/3/mypermissions?issueId=${issueId}&amp;amp;permissions=EDIT_ISSUES`&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then &lt;strong&gt;fail closed&lt;/strong&gt;: a non-200, a thrown error or a missing field all mean "no". Seeing a work item is not permission to change it. Our starter kit checks &lt;code&gt;BROWSE_PROJECTS&lt;/code&gt; the same way before reading, so it doesn't depend on which context fields are safe to trust (more on that below).&lt;/p&gt;

&lt;p&gt;Two more rules that saved us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When the browser sends an item id, check the item belongs to the work item the user is actually in, and answer "not found" for both "missing" and "someone else's". Ids of other work items then leak nothing.&lt;/li&gt;
&lt;li&gt;Any screen &lt;strong&gt;outside&lt;/strong&gt; a work item (a project page, a dashboard gadget) gets no help from Jira at all. Filter the list to what the user may see first, for example with a JQL search run as the user (&lt;code&gt;id in (...)&lt;/code&gt;). We tested the GET form with an unknown id and a deleted id: Jira simply left them out. We have &lt;strong&gt;not&lt;/strong&gt; tested an id hidden by issue security, which is the case that check exists for.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;How we know:&lt;/em&gt; the missing check was caught in code review. The permission call is Jira's documented &lt;code&gt;mypermissions&lt;/code&gt; endpoint. The issue-security case is untested.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Careful error handling can swallow the consent error
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What happens.&lt;/strong&gt; When a user hasn't allowed your app to act as them, &lt;code&gt;asUser()&lt;/code&gt; calls throw an error named &lt;code&gt;NEEDS_AUTHENTICATION_ERR&lt;/code&gt;. Atlassian's &lt;code&gt;requestJira&lt;/code&gt; reference says that if this error is &lt;strong&gt;not&lt;/strong&gt; caught, the user is prompted to allow access.&lt;/p&gt;

&lt;p&gt;Now look at what fail-closed code does: it catches every error and returns "no". That also catches this one, so it can hide the prompt, and the user would just see "no permission". It's also easy to miss in testing, because the account you test with has usually allowed the app already.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; Let that one error through, in every &lt;code&gt;catch&lt;/code&gt; around &lt;code&gt;asUser()&lt;/code&gt; and in your resolver wrapper:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'NEEDS_AUTHENTICATION_ERR'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// let Forge prompt the user&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'canEdit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// log the name only&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It grants nothing (the call still failed), so it's safe either way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An honest caveat.&lt;/strong&gt; Atlassian announced in 2021 that it was removing the per-user prompt in most cases, with admins consenting for users. So on a current site you may never meet this error. We had no never-used account to test with. Pass it on anyway, then test once with an account that has never opened your app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;While you're in there: trust the context, not the payload.&lt;/strong&gt; Take "who" and "where" from the resolver's &lt;code&gt;context&lt;/code&gt;, never from the &lt;code&gt;payload&lt;/code&gt;, which is whatever the browser sent. But don't assume every context field is safe for authorization: &lt;code&gt;accountId&lt;/code&gt; is documented as trustworthy, and we've seen reports that not every value is guaranteed. Check &lt;code&gt;extension.issue&lt;/code&gt; on the current resolver docs. Re-checking with Jira, as in trap 1, makes the question moot.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How we know:&lt;/em&gt; our own code swallowed the error, and a second reviewer caught it. The prompt behavior is from Atlassian's docs. The 2021 change is a community announcement, and the live behavior is untested by us.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. UI Kit list rows can act on the wrong item
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What happens.&lt;/strong&gt; We added Up and Down buttons to reorder the checklist. After a move, the rows showed the new order, but the &lt;strong&gt;buttons stayed attached to the old positions&lt;/strong&gt;. Clicking "Down" on one row moved its neighbor. The rows were keyed by the item id, which is what every React tutorial tells you to do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; Put the position in the key:&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="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Inline&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sb"&gt;`${index}:${item.id}`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* row content and buttons */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Inline&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that change, the moves we tried in the panel each landed on the right row. The same pattern applies to tables, and to any list you filter or hide rows in, because those change positions too. If your table's "Mark done" can act on a filtered list, test it after the filter changes.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How we know:&lt;/em&gt; we saw it live, in an issue panel, and checked the fix there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other eleven
&lt;/h2&gt;

&lt;p&gt;These three come from a guide of 14 traps we wrote up while building. The rest cover Custom Entities schema rules, list paging, deletion and moved work items, logs, web triggers, testing permissions on a free site, read-before-write, usage billing and the Marketplace checklist.&lt;/p&gt;

&lt;p&gt;The full guide, plus a working Forge app built around them, comes as a paid kit: &lt;a href="https://jayd1983.gumroad.com/l/forge-starter-kit" rel="noopener noreferrer"&gt;Forge Starter Kit for Jira&lt;/a&gt; ($29; I'm the seller). The three traps above are also a free PDF: &lt;a href="https://jayd1983.gumroad.com/l/forge-traps-free-preview" rel="noopener noreferrer"&gt;free preview&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was written with AI assistance, from our own build and review notes. Our app ran on a live Jira Cloud site with Forge CLI 16 and the nodejs24.x runtime, November 2026. Forge changes often; check anything you rely on against the current docs.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>atlassian</category>
      <category>jira</category>
      <category>forge</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
