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

Use Assets in Jira Forms

Kaja Iske
Contributor
June 22, 2023

Hi,

is there a way to use Assets in Forms (Data Center)? In a cloud test version I had the opinion to add an asset field. But I can't find this opinion in our Data Center verison.

Thank you!

2 answers

1 vote
Carlos Madera
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2024

Hey All -

I was able to create a workaround using the ProForma API and automations. This requires hitting the API but I will try to include simple steps so anyone can create it. Follow the steps below and let me know if you have questions.

  1. Create a ProForma connection to the assets
    1. Go to administration
    2. Manage Apps
    3. Select "Connections" in the ProForma Tab
    4. Select Add Conection
    5. Include the URL to perform an AQL search through via the API
      1. https://baseURL/rest/assets/1.0/aql/objects?iql=objectType={{objectType}}&resultPerPage=100000&includeAttributes=False&objectSchemaId={{schemaID}}
        1. If you have multiple forms on one issue you might need to update the 1, I only ever have 1 form per issue.
    6. Select Custom for Authentication, and copy and paste your API key here.
    7. Test your connection
      1. If you are having trouble here and not getting 200
        1. Check your API Key
        2. Check the URL and AQL are valid by pasting directly into your browser
    8. Configure your connection
      1. Select objectEntries for Items
      2. Select id for ID
      3. Select label for Label
    9. Confirm your connection
  2. Configure an automation
    1. You will need two web requests here one to get the data from the form, and another to find the refence in Assets. After you've set your trigger and conditionals add the following
    2. Send Web Request to ProForma API
      1. WebhookURL: https://baseURL/rest/proforma/1/issue/{{issue.key}}/form/1/answers
      2. Headers
        1. Accept: application/json
        2. Authorization: Bearer {{yourAPIkey}}
        3. HTTP Method: GET
        4. Webhook Body: Empty
        5. Wait For Response: Select this
    3. Create Variable for the answer 
      1. You'll get an array of answers and you'll need to select the exact piece of info you want. The answers are included in order, so if you have conditional sections you may need to create separate automations so you know exactly how many answers the data you are looking for is.
      2. Use smart value to get answer. Remember arrays start from 0 so subtract 1 from the order you are looking for. Log the array if you are having trouble!
        1. {{webhookResponse.body.get({{answerNumber}}).answer}}
    4. Send Web Request to JSM Assets API to do an AQL Search
      1. https://baseURL/rest/assets/1.0/aql/objects?iql={{IQL.urlEncode}}&objectSchemaId={{schemaID}}
        1. Play around with this. The URL encoding is finicky and I found if I can get the API call to populate in browser, I can copy the URL into the automation
      2. Accept: application/json
      3. Authorization: Bearer {{yourAPIkey}}
      4. HTTP Method: GET
      5. Webhook Body: Empty
      6. Wait For Response: Select this
    5. Create Variable to identify the objectKey you are looking for
      1. {{webhookResponse.body.objectEntries.objectKey}}
    6. Edit issue fields
      1. This changes based on what kind of field you are using. You can try smart values to change this but may need to use advanced. Also tricky, but d
      2. {
        "fields": {
        "customfield_XXXX": [
        {"key": "{{ObjectKey}}"}
        ]
        }
        }

That should be it!

Renan Ropke
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 18, 2024

Excellent, with the first configuration it is already possible to get the data from asset objects into the proforma, which will help in 90% of the cases. The second step is more about updating the asset objects from a proforma form.

0 votes
David Hämmerle June 23, 2023

There are Assets related field types under "Administration --> Issues --> Custom fields --> Add custom field" in the Data Center version of Jira/JSM. For example types "Assets object", "Assets readonly object".

23-06-2023_10-19-47.png

 

Field Set-Up doc: Set up the Assets objects custom field | Jira Service Management Cloud | Atlassian Support

Configuration of type "Assets object"-customfield doc: Configure the Assets objects custom field | Jira Service Management Cloud | Atlassian Support

Kaja Iske
Contributor
June 23, 2023

Hi David, thank's for your response! The customer field I've already found. But I don't know how to use the field in Forms. 

I cannot find it in the "Linked Jira Fields". Also in the cloud version I had the option to use the assets as a question field (so without a linked jira field). But in Data Center I cannot find this option.

David Hämmerle June 28, 2023

Eg. for adding the Custom Field of Type "Assets object" the documentation under following link also seems true for the Data Center Version of JSM: Customize the fields of a request type | Jira Service Management Cloud | Atlassian Support 

You may also need to configure the field on your "Create Screen" for the corresponding Project und "Issues --> Screens".

Kaja Iske
Contributor
June 28, 2023

That is unfortunately not yet what I mean :( I try to explain it more detailed:

I mean the Jira ProForma (called Forms). I want to use some forms for our request types. The option to add a asset customer field to a request type I've allready found.

But I want to add the assets to a form in ProForma and then add it to a request type.

In the cloud version I had this option:

forms.PNG
I cannot find this option in Data Center and also the link to the customer field is not given.

I hope you understand now what I mean :)

Kaja Iske
Contributor
June 28, 2023

I also contacted the Atlassian support and they said to me that they have this integration in their backlog ([FORMDC-27] Proper proforma/forms integration with Insight fields - Create and track feature requests for Atlassian products.)

So, thanks for your help and I hope this integration will come soon :-)!

Like David Hämmerle likes this
Paul Ceronio
Contributor
March 11, 2024

Does this mean, if an Agent creates a new issue in our Jira Service Management Data Center instance, he would not be able to select e.g. the affected device in the Create Issue form from a field that is fed from JIRA Assets?

If this is not possible, it would be a serious showstopper for us in terms of using JIRA Service management any further.

Kaja Iske
Contributor
March 11, 2024

Yes, in Data Center you're not able to use Asset fields in forms (https://jira.atlassian.com/browse/FORMDC-27)

Like Paul Ceronio likes this
Paul Ceronio
Contributor
March 12, 2024

Hi Kaja, thanks for your reply.

Can I ask what you implemented as a workaround/best practice?

Kind regards

Paul

Kaja Iske
Contributor
March 12, 2024

Hi Paul,

unfortunately, we don't have a workaround and hope that Atlassian will implement the feature :-(. We need it for our portals in JSM and won't be using forms until then.

Like Paul Ceronio likes this
Paul Ceronio
Contributor
March 12, 2024

Hi Kaja, thanks for confirming. I've also commented on the Issue  (FORMDC-27) now. Will have to wait and see...

Like Kaja Iske likes this
Paul Ceronio
Contributor
March 12, 2024

Sorry, just another quick detail to confirm:

So in practical terms, if your Agent wants to change data in connection with a specific items in response to an issue, he/she

1. goes to Assets in Jira Serv. Man.,

2. selects the relevant Object Schema,

3. looks for the relevant item and

4. then changes the data in the relevant entry?

Kaja Iske
Contributor
March 12, 2024

So you mean changing data in an object?

Paul Ceronio
Contributor
March 12, 2024

Yes indeed, e.g., changing the Incident status (for the object) from "Running" to "Support requested". Or changing the Owner.

My assumption is that there is no way to create a link in the Issue Ticket to that specific object in Assets.

So the only way to update data about the object is directly in the Schema, right?

Kaja Iske
Contributor
March 12, 2024

Yes, we only change the data in the object itselfs.

You only can show object informations in the issue with an asset custom field.

Like Paul Ceronio likes this
Paul Ceronio
Contributor
March 12, 2024

Super, thanks, I've just been reading up on asset custom fields too. The problem is much clearer now.

Like Kaja Iske likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events