Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing tempo using Java

amiddleton
February 20, 2018

Hi

I'm trying to use java to get a custom field related to a worklog item, but I'm struggling to work out how to do this.

My guess is that I need to reference the tempo package in my POM to get extra methods available but I'm not sure where to start. All the documentation seems to point to REST APIs rather than anything meaningful in java.

 

Can anyone help point me in the right direction please? I'm using tempo version 8.0.2

The code I have at the moment is:

{CODE}

String onSite = (String) event.getWorklog().
.getCustomFieldValue(getCustomField("Onsite work"));

{CODE}

The getCustomFieldValue() method works great when getting a custom field related to a JIRA issue, but not to the worklog.

 

thanks

 

Andy

2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
3 votes
Answer accepted
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 28, 2021

A tab cannot be made required or not required.

You can only hide/show a tab.

You will have to make all the fields in the tab required or not one by one.

surender k
December 28, 2021

Thanks Peter

surender k
December 29, 2021

Hi Peter

Still I am not able to sort out. could you provide a script on behaviours

If I select "Business services"(value)

in "Business Driver" (Elements connect field) 

then other fields "ID Impact, Product Impact, PD Houses" to non mandatory.

PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 31, 2021

Assuming the fields is not flagged as required (all fields must be set to optional) in the project's field configuration a script like this should work:

def busDriverFld = getFieldByName('Business Driver')
def tabFieldNames = ['ID Impact', 'Product Impact', 'PD Houses']

def requiredBySelection = busDriverFld.value != 'Business services'

tabFieldNames .each{fieldName->
getFieldByName(fieldName).setRequired(requiredBySelection)
}

 Be sure to confirm the spelling of all field names and values (including correct case).

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 29, 2021

Tabs do not have an optional/mandatory setting, but they look like they do when they contain a mandatory field.

Behaviours can not make a field optional if it is set mandatory in Jira - the mandatory setting is checked on the server-side as the issue is created, and Behaviours can't get to that.

So, to make a tab "optional", you have to make all the fields within it optional in the field configuration.

You can use Behaviours to completely hide a tab, but you'll need to have all the fields on it optional.

surender k
December 29, 2021

Thanks Nic

could you provide a script on 

If I select "Business services"(value)

in "Business Driver" (Elements connect field) 

then other fields "ID Impact, Product Impact, PD Houses" to non mandatory.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 30, 2021

Again, you cannot make a field non-mandatory with Behaviours.  You have to make the field optional in the field configuration.

TAGS
AUG Leaders

Atlassian Community Events