Confiforms: Count Story Points from all Stories that are linked to Epic - JIRA connection
Asked by HR:

Hello,

I build the Confiforms logic where I am reading data from JIRA. In JIRA I have many Epics and linked Stories.

**What I would like to achieve** is to add to the form only the key of the Epic and see the list of dependent / linked Stories. For every single story, I need to read the value of the Story Point and on the form, I need to add up these numbers and display the on the form.

**What I already achieved**

I have the form where I can add or search for any JIRA issue, story, or Epic. I am able to read the status and the value of the Story Points.

I am able also to read a number of stories when I add to the form JQL script.

I didn't find a way to have the listed **keys** of linked stories to the Epic via linked to Epic as Array or any other way where I will be able to parse and read story points by any other script.

Here is my code:

*** ** * ** ***

```
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="0ac060cf-c01e-4b08-bccf-6ecba9bc13a2" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="ffda1fef-a7fc-4eda-8659-ef0107f79012" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="embedded">true</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="04f94039-92fb-4804-a362-d1a7535a7dd2" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="css">max-width:300px;width:300px;</ac:parameter>
<ac:parameter ac:name="fieldName">keyCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">JIRA ticket #</ac:parameter>
<ac:parameter ac:name="extras">Jira</ac:parameter>
<ac:parameter ac:name="fieldDescription">projectkey-000</ac:parameter>
<ac:parameter ac:name="type">jira</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="9c923c23-b604-428e-93f8-7b068fafd1e5" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!keyCF:[empty]</ac:parameter>
<ac:parameter ac:name="fieldName">reporterCF=fields.reporter.name&amp;summaryCF=fields.summary&amp;statusCF=fields.status.name&amp;storypointsCF=fields.customfield_10008&amp;fixversionCF=fields.fixVersions.name&amp;labelsCF=fields.labels.asArray&amp;epiclinkCF=fields.customfield_18300&amp;issuetypeCF=fields.issuetype.name</ac:parameter>
<ac:parameter ac:name="values">[entry.keyCF]</ac:parameter>
<ac:parameter ac:name="action">Lookup and set JIRA issue data</ac:parameter>
<ac:parameter ac:name="actionFieldName">keyCF</ac:parameter>
<ac:parameter ac:name="values2">Jira</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="68ea6f80-a1eb-4dc5-9fc1-8090c0cbd9f4" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">reporterCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Reporter field from JIRA</ac:parameter>
<ac:parameter ac:name="type">user</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="1db610be-8bcb-4ec3-9842-532156138aea" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">summaryCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Summary</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="8f17aaf8-f3fb-44b4-80d3-091f480a676d" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">statusCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Status</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="5eb44cf3-95c0-4ca4-ab3c-b3764f63562e" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">storypointsCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Story Points</ac:parameter>
<ac:parameter ac:name="type">hidden</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="16c314c8-3111-4651-a952-2ed178631c38" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">Roundednumber</ac:parameter>
<ac:parameter ac:name="fieldLabel">Story Points</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="8266e5eb-6f21-4835-b3eb-d2e03bd3eff3" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="values">Roundednumber=ROUND(storypointsCF,2)</ac:parameter>
<ac:parameter ac:name="action">Set expression</ac:parameter>
<ac:parameter ac:name="actionFieldName">storypointsCF</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="7ce2f073-cc47-46b7-9de3-8fc2e441fc2d" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">fixversionCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Fix Version</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="b0ff8473-dbee-41f3-9ad2-5297200455ca" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">labelsCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Labels</ac:parameter>
<ac:parameter ac:name="type">confluencemultilabel</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="078844d3-a855-4f05-b038-5792b47f82bb" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">epiclinkCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Group</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="c1d138f9-88e3-4d31-9a4b-aba8b5dc06ef" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">issuetypeCF</ac:parameter>
<ac:parameter ac:name="fieldLabel">Issue Type</ac:parameter>
<ac:parameter ac:name="type">text</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="77e6daaa-8c15-428d-98ac-5453d9fd463e" ac:name="confiform-table" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="aee3ccb6-c31d-44c4-8cc8-781e0c1ada18" ac:name="confiform-entry-edit" ac:schema-version="1">
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
```


Answers:
author: HR
body: So there is another way how to achieve to get a list of all stories related to the Epic but this requires the use of the parameter in the JQL

issueFunction in issuesInEpics('key=\[entry.keyCF\]')

Is it the possible way how to receive the list of keys or any other parameter from JIRA?


author: Alex Medved _ConfiForms_
body: Hi [@HR](/t5/user/viewprofilepage/user-id/3626911)

Do you know if the Jira issue you are retrieving from Jira has this information included in the object?

Alex

comments: author: HR
body: Yes, there is no problem retrieving data from JIRA however, I do not know how to add a request to JIRA as following JQL:

project = GMAx AND issuetype = Story AND issueFunction in issuesInEpics('key=xxx') {#toc-hId--439134056}
--------------------------------------------------------------------------------------------------------

and use key as parameter.


author: HR
body: Honestly, I do not know if this is in the object. Is there any way how I can figure it out?


author: Alex Medved _ConfiForms_
body: Not quite what I was asking...

to see what Jira returns and ConfiForms sees you can by following the concept shown here <https://wiki.vertuna.com/display/CONFIFORMS/Accessing+Jira+issue+fields+directly+from+ConfiForms+using+Jira+issue+field>


author: HR
body: What is working for me I am able to retrieve data from JIRA using Confiform Rules with Action "Lookup and set JIRA issue data"

Maybe a do not understand clearly how this "bridge" is properly setup.

In This "ConfiForms Rules for Field Definition" I have setup Application link to JIRA and this works.

For values set I properly working:

reporterCF=fields.reporter.name\&summaryCF=fields.summary\&statusCF=fields.status.name\&storypointsCF=fields.customfield_10008\&fixversionCF=fields.fixVersions.name\&labelsCF=fields.labels.asArray\&epiclinkCF=fields.customfield_18300\&issuetypeCF=fields.issuetype.name

What I do not clearly understand is the setup this bridge for Applink or if I can simply use the Rule as explained above.


author: Alex Medved _ConfiForms_
body: Where is nothing else to "setup" - but ConfiForms can work only with what JIra returns... and that was my question - does it return the data you are looking for (as a part of Jira issue)?

Alex


author: HR
body: Yes, I am receiving data from JIRA. My issue is I do not know how to set up the request where the answer will be the list of keys linked to the Epic.


author: HR
body: I did a couple more tests for the values from the link you provided to me:

<https://wiki.vertuna.com/display/CONFIFORMS/Accessing+Jira+issue+fields+directly+from+ConfiForms+using+Jira+issue+field>

I have one more question about this. If this is the complete list of all variables/values you can retrieve from JIRA. I see you can read for example sub-task key, (this is working for me) but I didn't find the value/path for "links in Epic"

If I try value like a issuelinks I will receive \[object Object\]


author: Alex Medved _ConfiForms_
body: That was really my question to you - to check what the Jira issue object has and if iot has the "links in Epic"...

If I look at the "issuelinks" I can see it is an array of linked Jira issues. Of course if you ask to get just the issuelinks property then you will get what you see - an unspecified and untyped object

Alex


author: HR
body: I am sorry for this misunderstanding.

What will be then the path which I need to add to the keyCF field as above?

JiraIssueLinksCF=**fields.???**

this is what I am looking for.

Thanks for your understanding

Jaromir


author: Alex Medved _ConfiForms_
body: Path to get WHAT exactly from the issue links object?


author: HR
body: I need to see the keys of Stories linked to this Epic in the same way I see sub-tasks on this screenshot

![Screenshot 2023-08-15 at 11.47.53.png](https://community.atlassian.com/t5/image/serverpage/image-id/275180i10EE297FEF498D28/image-size/large?v=v2&px=999 "Screenshot 2023-08-15 at 11.47.53.png")


author: Alex Medved _ConfiForms_
body: OK, let's say you want access the values for the issuelinks of an "inwardIssue" type

According to the structure returned by Jira you will do something like this

```
linkedIssues=[entry.jiraIssue.fields.issuelinks.inwardIssue.key]
```

Assuming the field you want to set this to is named "linkedIssues" and the field you have your Jira key is named "jiraIssue"

Little demo below

<http://recordit.co/1emG2GZ0bu>

Alex


author: HR
body: Hi Alex,

Thanks for your response and nice little demo. Unfortunately, it still doesn't work for me. See my little demo and source code

<https://recordit.co/rwhgaLaRa7>

```
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="764b619c-02f2-49c2-b950-3fc50f897ef8" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="3c2b26f3-a7c3-4542-a4b5-a772bf247cba" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:parameter ac:name="type">Embedded</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="85a9b1d3-bd9e-468c-b96d-18277b3f4fa5" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">jiraIssue</ac:parameter>
<ac:parameter ac:name="fieldLabel">JIRA Issue</ac:parameter>
<ac:parameter ac:name="extras">Jira</ac:parameter>
<ac:parameter ac:name="type">jira</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>?<ac:structured-macro ac:macro-id="7d9652fc-a20f-421d-bfa3-d0a9943a9123" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">!jiraIssue:[empty]</ac:parameter>
<ac:parameter ac:name="values">linkedIssues=[entry.jiraIssue.fields.issuelinks.inwardIssue.key]</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">jiraIssue</ac:parameter>
</ac:structured-macro>
</p>
<p class="auto-cursor-target">
<ac:structured-macro ac:macro-id="0d02b26c-1831-4bf4-8ef2-780d243426e6" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">linkedIssues</ac:parameter>
<ac:parameter ac:name="fieldLabel">Linked Issues</ac:parameter>
<ac:parameter ac:name="type">confluencemultilabel</ac:parameter>
<ac:parameter ac:name="required">true</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p>
<br/>
</p>
<p class="auto-cursor-target">
<br/>
</p>
```


author: Alex Medved _ConfiForms_
body: Do you have any inward issues linked to the ticket you have selected in a demo?


author: HR
body: I need to find the keys on my demo where they are marked as "issues in Epic"


author: Alex Medved _ConfiForms_
body: That comes back to my original question - are they part of the issue object?


author: HR
body: No there are no inwardIssues.


author: HR
body: I have been thinking of one more possibility to receive the list of keys or any other variable from JIRA.

For me is working via Jira JQL field where I could use as a parameter only the key which I am adding to the field keyCF

then the value should be

epiclinks=issueFunction in issuesEpics('key=\[entry.keyCF\]'). Unfortunately, I am receiving an issue from this as well.


author: Alex Medved _ConfiForms_
body: Well, I believe that answers the question you asked in the demo you have recorded, right? If there is no data in the Jira object then you cannot retrieve it


author: HR
body: ok, I understand. Thanks Alex


Tags: confiforms

confluence-server

jira

server