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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,417
Community Members
 
Community Events
184
Community Groups

Jira AbstactService properties field does not appear

Edited
Jens Kisters __SM
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 Leaders.
Apr 19, 2018

Hello,

 

i am trying to register a service which has a paramter field just like script runner does:

Unbenannt.PNG

I have defined a field in the properties xml file but the field does not appear.

 

XML:

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</properties>
</importcsvservice>

Java Code:

package aptis.plugins.meetingTime.presence;
import com.atlassian.configurable.ObjectConfiguration;
import com.atlassian.configurable.ObjectConfigurationException;
import com.atlassian.jira.service.AbstractService;
import java.util.Map;

public class ImportFromFileJob extends AbstractService {

private ActiveObjects activeObjects;

@Override
public void run() {
try {
ObjectConfiguration objectConfiguration = this.getObjectConfiguration();
Map fieldValues = objectConfiguration.getFieldValues("admin.service.fileimport.sourcefile");
} catch (ObjectConfigurationException e) {
e.printStackTrace();
}
}

@Override
public ObjectConfiguration getObjectConfiguration() throws ObjectConfigurationException {
return getObjectConfiguration("importcsvservice", "xml/presence-service-properties.xml", null);
}

}

Any Ideas where the problem is?

 

Thanks in advance!

Jens 

1 answer

Hi Jens,

try to correct the service xml configuration:

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</properties>
</importcsvservice>

to the following one (you missed the property element):

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<property>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</property>
</properties>
</importcsvservice>

and properties can be easily accessed in the init method
public void init(PropertySet props) throws ObjectConfigurationException {
......
}
Regards Götz

Jens Kisters __SM
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 Leaders.
Mar 17, 2021

Thanks for your answer, unfortunately im not working on this project any more and can't try this out (the jira instance doesnt exist any more)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events