Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Rest API raise event "Issue Updated"

Is it possible in the REST API to trigger an event?

I need to raise event "Issue Updated" via REST API without any changes.

I'm working with plugin "Big Picture", and after adding issue link - Big picture do not capture this change. But if I do something after with this task (change description, or something else) - event has been raised, and big picture creates issue link in Gannt diagram.

2 answers

1 accepted

0 votes
Answer accepted

Hello @Roman Yashchenko ,

Welcome to the Atlassian Community!

Currently there is no way to trigger an event via REST API and, anyway, doing this might have undesired side-effects since an issue updated event may trigger email notifications and/or other actions in your Jira instance.

However, reading what you are trying to achieve, I would say this is something you should bring to the attention of the app vendor since:

  1. According to the Types of Synchronization in BigPicture and BigGantt plugins documentation page, the partial sync is triggered by the  issue_createdissue_updated and issue_deleted events.
  2. When an issue is linked, the event fired is actually issuelink_created. This can also be seen in the Jira Webhooks configuration page:

    WebHooks-issue-related-events.jpg

 

 

Please get in touch with the app vendor by using the resources listed in the support tab of the marketplace page for BigPicture:

Contact

 

Also, as a temporary/dirty workaround for your issue, you can create a Jira automation rule (global or project specific) that will actually update the issue (e.g. adding a label, or setting a field) every time an issue is linked.

For details on how to do so, please see: Automate your Jira Cloud processes and workflows

 

I hope this helps.

 

Cheers,
Dario

Hi @Roman Yashchenko 

Please excuse me for the untimely response on this matter. 

We verified the behavior internally and, according to our tests, the links appear in the Gantt chart immediately after creating a link in the Jira issue. 

Would you be able to test and confirm if this is true for you as well?

Thank you in advance for letting me know!

Best regards,

Mateusz Sołowianiuk

SoftwarePlant Support

Hello.

As you can see, when I create issuelink thru REST API , it doesn't create on BigPicture:

1.png

but it creates in issue links:

2.png

Only, when I change description to another value - raise event "issue updated", and after that link creates on big picture:

3.png

There is a VBA code:

Sub test001()
createLink "TESTINVEST-8926", "TESTINVEST-8927"
End Sub

Sub createLink(ByVal sourceKey As String, ByVal targetKey As String, Optional ByVal linkType As String = "Gantt End to Start")
jira.sendRequest "/rest/api/2/issue/" & sourceKey, "PUT", "{""update"":{""issuelinks"":[{""add"":{""type"":{""name"":""" & linkType & """},""outwardIssue"":{""key"":""" & targetKey & """}}}]}}"
'therre is no link on big picture

descr = JsonConverter.ParseJson(jira.getIssues("key=" & sourceKey))("issues")(1)("fields")("description")
jira.updateIssue sourceKey & "", , "link added"
'there is link creates on big picture
jira.updateIssue sourceKey & "", , descr & ""

End Sub

Function sendRequest(address As String, Optional method As String = "GET", Optional requestText As String = "")
TargetURL = getProperty("jira.protocol") & "://" & getProperty("jira.address") & ":" & getProperty("jira.port") & address
Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1")

myuser = getProperty("jirausername")
mypass = getProperty("jirapassword")
sAuth = main.TextBase64Encode(myuser & ":" & mypass, "us-ascii")

HTTPReq.Open method, TargetURL, False
HTTPReq.setRequestHeader "Content-Type", "application/json"
HTTPReq.setRequestHeader "Authorization", "Basic " & sAuth
HTTPReq.setRequestHeader "x-experience-api-version", "1.0.0"
HTTPReq.send (requestText)
sendRequest = HTTPReq.responseText

End Function

 

Hello.

As you can see, when I create issuelink thru REST API , it doesn't create on BigPicture:

1.png

but it creates in issue links:

2.png

Only, when I change description to another value - raise event "issue updated", and after that link creates on big picture:

3.png

There is a VBA code:

Sub test001()
createLink "TESTINVEST-8926", "TESTINVEST-8927"
End Sub

Sub createLink(ByVal sourceKey As String, ByVal targetKey As String, Optional ByVal linkType As String = "Gantt End to Start")
jira.sendRequest "/rest/api/2/issue/" & sourceKey, "PUT", "{""update"":{""issuelinks"":[{""add"":{""type"":{""name"":""" & linkType & """},""outwardIssue"":{""key"":""" & targetKey & """}}}]}}"
'therre is no link on big picture

descr = JsonConverter.ParseJson(jira.getIssues("key=" & sourceKey))("issues")(1)("fields")("description")
jira.updateIssue sourceKey & "", , "link added"
'there is link creates on big picture
jira.updateIssue sourceKey & "", , descr & ""

End Sub

Function sendRequest(address As String, Optional method As String = "GET", Optional requestText As String = "")
TargetURL = getProperty("jira.protocol") & "://" & getProperty("jira.address") & ":" & getProperty("jira.port") & address
Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1")

myuser = getProperty("jirausername")
mypass = getProperty("jirapassword")
sAuth = main.TextBase64Encode(myuser & ":" & mypass, "us-ascii")

HTTPReq.Open method, TargetURL, False
HTTPReq.setRequestHeader "Content-Type", "application/json"
HTTPReq.setRequestHeader "Authorization", "Basic " & sAuth
HTTPReq.setRequestHeader "x-experience-api-version", "1.0.0"
HTTPReq.send (requestText)
sendRequest = HTTPReq.responseText

End Function

@Roman Yashchenko 

Thank you for providing this - I understood you incorrectly and was verifying a different scenario. I am verifying this with our developers again for full confirmation. I will post it in this thread once I have more details. 

Best regards,

Mateusz Sołowianiuk

Like Dario B likes this

@Roman Yashchenko 

Thank you for your patience regarding this. 

Please be informed that our developers managed to create a link in Jira using the POST HTTP method. The link appeared in the Gantt chart instantly after refreshing the page. This is the code that was used:

POST https://INSTANCE-NAME.atlassian.net/rest/api/2/issueLinkContent-Type: application/json
Authorization: Basic bWFyY2luLmtpdGFAc29mdHdhcmVwbGFudC5j********
{
 "outwardIssue": {
 "key": "SCRUM-1"
 },
 "inwardIssue": {
 "key": "SCRUM-2"
 },
 "type": {
 "name": "Gantt End to Start"
 }
}

Also, our developer found that your code does not meet some of the requirements listed in the documentation. The key differences are:

  • a different HTTP method;
  • a different Endpoint;
  • an additional header 'x-experience-api-version", "1.0.0"'

Please verify if such a command will work for you. 

Last but not least, I suggest that, in case of further questions, this discussion is moved to our Service Desk as it will facilitate including the developers in the discussion in a huge extent. 

I hope that this helps, though :)

Best regards,

Mateusz Sołowianiuk

Like Dario B likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,184 views 8 28
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you