Adding Jira Comments through Confiforms

Rayman Bacchus
Contributor
January 23, 2025

I use Confiforms to create and update JIRA's as necessary.  There are two IFTTT's one for when an intake is created it will CREATE the Jira page and one if the Confluence page that displays intake details is updated then another IFTTT performs an update.  All that works fine.

However, I am wondering if I can add comments to the JIRA

I currently have this (shortened example below):

 

 

So am wondering if I can add something like "comments" : "[entry.IntakeMins.escapeJSON]"

so an comment can be added to the JIRA page?

 

 

 

{
   "fields": {
   		"project":
      		{ 
         		"key": "******"
      		}, 
      	"issuetype"         : {  "name": "Task" },     
      	"priority"          : {  "name": "Medium" },
      	"summary"           : "[entry.InitiativeName.escapeJSON]",        
      	"assignee"          :  {  "name": "[entry.DefaultAssignee]" },
      	"customfield_24100" : "[entry.StartDate.jiraDateTime]", 
      	"customfield_24101" : "[entry.EndDate.jiraDateTime]", 
      	"customfield_30000" : { "value": "Product Family" },
      	"reporter"          : {  "name": "[entry.createdBy]" },
      	"components"        : [{"name":"CIAM Work Origination"}],

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2025

As far as I know, but you can always check Atlassian documentation on this, the comment needs to be added through a separate API call

https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-addComment

Little video to help

Rayman Bacchus
Contributor
January 25, 2025

Thank's as always Alex!  That worked - and I can now add a comment to the JIRA page.

What's even better is when I ask for the ifttt_Result 

CIAMAmountid=${iftttResult_JIRAComment01}

I get full results.  The question is - how do I pull ONLY the id?  I tried this:

CIAMAmountid=${iftttResult_JIRAComment01.id}

but that does not seem to work - although I think it should.  Any ideas?

To Post the Comment:
Event: onModified
Action:  AppLink service
Method: POST
server url: /rest/api/2/issue/[entry.CIAMJiraKey]/comment
custom name for action:  JIRAComment01

To Pull Results of Comment Posted:
Event: onModified
Action: Create/Update Confiforms Entry
Parameters to set on the entry: entryId=[entry.id]&timestamp=[now]&CIAMAmountid=${iftttResult_JIRAComment01.id} -  This is where I think I pull only id

 

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2025

The thing is, you cannot apply a function on the IFTTT result and ConfiForms does not know for sure if the response was JSON or anything else.

So there are 2 options

  • Save the whole response into CIAMAmountid and then in the view, when adding the ConfiForms Field macro to show the specific field you can put the field name with asJSON transforming function to have something like CIAMAmountid.asJSON.id to show the ID 
  • Have 2 sequential ConfiForms IFTTTs of "Create/Update Confiforms Entry" type with parameters as follows
    • entryId=[entry.id]&timestamp=[entry._now]&CIAMAmountid=[iftttResult_JIRAComment01]
    • entryId=[entry.id]&CIAMAmountid=[entry.CIAMAmountid.asJSON.id]

 

BTW, use of "[now]" is incorrect - this will ALWAYS show the current date/time, not the date/time of the update, so I have fixed that

BTW2, the [now] has been deprecated for like 8 years ;-)

Alex

Like Rayman Bacchus likes this
Rayman Bacchus
Contributor
January 26, 2025

As always Alex you are a genius and abosultely great at what you do! 

THank you so much - I went with Option #1:

  • Save the whole response into CIAMAmountid and then in the view, when adding the ConfiForms Field macro to show the specific field you can put the field name with asJSON transforming function to have something like CIAMAmountid.asJSON.id to show the ID 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events